
obj/user/init.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 8f 03 00 00       	call   8003c0 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <sum>:

char bss[6000];

int
sum(const char *s, int n)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	56                   	push   %esi
  80003b:	53                   	push   %ebx
  80003c:	8b 75 08             	mov    0x8(%ebp),%esi
  80003f:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int i, tot = 0;
  800042:	b9 00 00 00 00       	mov    $0x0,%ecx
	for (i = 0; i < n; i++)
  800047:	b8 00 00 00 00       	mov    $0x0,%eax
  80004c:	39 d8                	cmp    %ebx,%eax
  80004e:	7d 0e                	jge    80005e <sum+0x2b>
		tot ^= i * s[i];
  800050:	0f be 14 06          	movsbl (%esi,%eax,1),%edx
  800054:	0f af d0             	imul   %eax,%edx
  800057:	31 d1                	xor    %edx,%ecx
	for (i = 0; i < n; i++)
  800059:	83 c0 01             	add    $0x1,%eax
  80005c:	eb ee                	jmp    80004c <sum+0x19>
	return tot;
}
  80005e:	89 c8                	mov    %ecx,%eax
  800060:	5b                   	pop    %ebx
  800061:	5e                   	pop    %esi
  800062:	5d                   	pop    %ebp
  800063:	c3                   	ret    

00800064 <umain>:

void
umain(int argc, char **argv)
{
  800064:	f3 0f 1e fb          	endbr32 
  800068:	55                   	push   %ebp
  800069:	89 e5                	mov    %esp,%ebp
  80006b:	57                   	push   %edi
  80006c:	56                   	push   %esi
  80006d:	53                   	push   %ebx
  80006e:	81 ec 18 01 00 00    	sub    $0x118,%esp
  800074:	8b 7d 08             	mov    0x8(%ebp),%edi
	int i, r, x, want;
	char args[256];

	cprintf("init: running\n");
  800077:	68 20 27 80 00       	push   $0x802720
  80007c:	e8 98 04 00 00       	call   800519 <cprintf>

	want = 0xf989e;
	if ((x = sum((char*)&data, sizeof data)) != want)
  800081:	83 c4 08             	add    $0x8,%esp
  800084:	68 70 17 00 00       	push   $0x1770
  800089:	68 00 30 80 00       	push   $0x803000
  80008e:	e8 a0 ff ff ff       	call   800033 <sum>
  800093:	83 c4 10             	add    $0x10,%esp
  800096:	3d 9e 98 0f 00       	cmp    $0xf989e,%eax
  80009b:	0f 84 99 00 00 00    	je     80013a <umain+0xd6>
		cprintf("init: data is not initialized: got sum %08x wanted %08x\n",
  8000a1:	83 ec 04             	sub    $0x4,%esp
  8000a4:	68 9e 98 0f 00       	push   $0xf989e
  8000a9:	50                   	push   %eax
  8000aa:	68 e8 27 80 00       	push   $0x8027e8
  8000af:	e8 65 04 00 00       	call   800519 <cprintf>
  8000b4:	83 c4 10             	add    $0x10,%esp
			x, want);
	else
		cprintf("init: data seems okay\n");
	if ((x = sum(bss, sizeof bss)) != 0)
  8000b7:	83 ec 08             	sub    $0x8,%esp
  8000ba:	68 70 17 00 00       	push   $0x1770
  8000bf:	68 20 50 80 00       	push   $0x805020
  8000c4:	e8 6a ff ff ff       	call   800033 <sum>
  8000c9:	83 c4 10             	add    $0x10,%esp
  8000cc:	85 c0                	test   %eax,%eax
  8000ce:	74 7f                	je     80014f <umain+0xeb>
		cprintf("bss is not initialized: wanted sum 0 got %08x\n", x);
  8000d0:	83 ec 08             	sub    $0x8,%esp
  8000d3:	50                   	push   %eax
  8000d4:	68 24 28 80 00       	push   $0x802824
  8000d9:	e8 3b 04 00 00       	call   800519 <cprintf>
  8000de:	83 c4 10             	add    $0x10,%esp
	else
		cprintf("init: bss seems okay\n");

	// output in one syscall per line to avoid output interleaving 
	strcat(args, "init: args:");
  8000e1:	83 ec 08             	sub    $0x8,%esp
  8000e4:	68 5c 27 80 00       	push   $0x80275c
  8000e9:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  8000ef:	50                   	push   %eax
  8000f0:	e8 23 0a 00 00       	call   800b18 <strcat>
	for (i = 0; i < argc; i++) {
  8000f5:	83 c4 10             	add    $0x10,%esp
  8000f8:	bb 00 00 00 00       	mov    $0x0,%ebx
		strcat(args, " '");
  8000fd:	8d b5 e8 fe ff ff    	lea    -0x118(%ebp),%esi
	for (i = 0; i < argc; i++) {
  800103:	39 fb                	cmp    %edi,%ebx
  800105:	7d 5a                	jge    800161 <umain+0xfd>
		strcat(args, " '");
  800107:	83 ec 08             	sub    $0x8,%esp
  80010a:	68 68 27 80 00       	push   $0x802768
  80010f:	56                   	push   %esi
  800110:	e8 03 0a 00 00       	call   800b18 <strcat>
		strcat(args, argv[i]);
  800115:	83 c4 08             	add    $0x8,%esp
  800118:	8b 45 0c             	mov    0xc(%ebp),%eax
  80011b:	ff 34 98             	pushl  (%eax,%ebx,4)
  80011e:	56                   	push   %esi
  80011f:	e8 f4 09 00 00       	call   800b18 <strcat>
		strcat(args, "'");
  800124:	83 c4 08             	add    $0x8,%esp
  800127:	68 69 27 80 00       	push   $0x802769
  80012c:	56                   	push   %esi
  80012d:	e8 e6 09 00 00       	call   800b18 <strcat>
	for (i = 0; i < argc; i++) {
  800132:	83 c3 01             	add    $0x1,%ebx
  800135:	83 c4 10             	add    $0x10,%esp
  800138:	eb c9                	jmp    800103 <umain+0x9f>
		cprintf("init: data seems okay\n");
  80013a:	83 ec 0c             	sub    $0xc,%esp
  80013d:	68 2f 27 80 00       	push   $0x80272f
  800142:	e8 d2 03 00 00       	call   800519 <cprintf>
  800147:	83 c4 10             	add    $0x10,%esp
  80014a:	e9 68 ff ff ff       	jmp    8000b7 <umain+0x53>
		cprintf("init: bss seems okay\n");
  80014f:	83 ec 0c             	sub    $0xc,%esp
  800152:	68 46 27 80 00       	push   $0x802746
  800157:	e8 bd 03 00 00       	call   800519 <cprintf>
  80015c:	83 c4 10             	add    $0x10,%esp
  80015f:	eb 80                	jmp    8000e1 <umain+0x7d>
	}
	cprintf("%s\n", args);
  800161:	83 ec 08             	sub    $0x8,%esp
  800164:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  80016a:	50                   	push   %eax
  80016b:	68 6b 27 80 00       	push   $0x80276b
  800170:	e8 a4 03 00 00       	call   800519 <cprintf>

	cprintf("init: running sh\n");
  800175:	c7 04 24 6f 27 80 00 	movl   $0x80276f,(%esp)
  80017c:	e8 98 03 00 00       	call   800519 <cprintf>

	// being run directly from kernel, so no file descriptors open yet
	close(0);
  800181:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  800188:	e8 76 11 00 00       	call   801303 <close>
	if ((r = opencons()) < 0)
  80018d:	e8 d8 01 00 00       	call   80036a <opencons>
  800192:	83 c4 10             	add    $0x10,%esp
  800195:	85 c0                	test   %eax,%eax
  800197:	78 14                	js     8001ad <umain+0x149>
		panic("opencons: %e", r);
	if (r != 0)
  800199:	74 24                	je     8001bf <umain+0x15b>
		panic("first opencons used fd %d", r);
  80019b:	50                   	push   %eax
  80019c:	68 9a 27 80 00       	push   $0x80279a
  8001a1:	6a 39                	push   $0x39
  8001a3:	68 8e 27 80 00       	push   $0x80278e
  8001a8:	e8 85 02 00 00       	call   800432 <_panic>
		panic("opencons: %e", r);
  8001ad:	50                   	push   %eax
  8001ae:	68 81 27 80 00       	push   $0x802781
  8001b3:	6a 37                	push   $0x37
  8001b5:	68 8e 27 80 00       	push   $0x80278e
  8001ba:	e8 73 02 00 00       	call   800432 <_panic>
	if ((r = dup(0, 1)) < 0)
  8001bf:	83 ec 08             	sub    $0x8,%esp
  8001c2:	6a 01                	push   $0x1
  8001c4:	6a 00                	push   $0x0
  8001c6:	e8 92 11 00 00       	call   80135d <dup>
  8001cb:	83 c4 10             	add    $0x10,%esp
  8001ce:	85 c0                	test   %eax,%eax
  8001d0:	79 23                	jns    8001f5 <umain+0x191>
		panic("dup: %e", r);
  8001d2:	50                   	push   %eax
  8001d3:	68 b4 27 80 00       	push   $0x8027b4
  8001d8:	6a 3b                	push   $0x3b
  8001da:	68 8e 27 80 00       	push   $0x80278e
  8001df:	e8 4e 02 00 00       	call   800432 <_panic>
	while (1) {
		cprintf("init: starting sh\n");
		r = spawnl("/sh", "sh", (char*)0);
		if (r < 0) {
			cprintf("init: spawn sh: %e\n", r);
  8001e4:	83 ec 08             	sub    $0x8,%esp
  8001e7:	50                   	push   %eax
  8001e8:	68 d3 27 80 00       	push   $0x8027d3
  8001ed:	e8 27 03 00 00       	call   800519 <cprintf>
			continue;
  8001f2:	83 c4 10             	add    $0x10,%esp
		cprintf("init: starting sh\n");
  8001f5:	83 ec 0c             	sub    $0xc,%esp
  8001f8:	68 bc 27 80 00       	push   $0x8027bc
  8001fd:	e8 17 03 00 00       	call   800519 <cprintf>
		r = spawnl("/sh", "sh", (char*)0);
  800202:	83 c4 0c             	add    $0xc,%esp
  800205:	6a 00                	push   $0x0
  800207:	68 d0 27 80 00       	push   $0x8027d0
  80020c:	68 cf 27 80 00       	push   $0x8027cf
  800211:	e8 d3 1c 00 00       	call   801ee9 <spawnl>
		if (r < 0) {
  800216:	83 c4 10             	add    $0x10,%esp
  800219:	85 c0                	test   %eax,%eax
  80021b:	78 c7                	js     8001e4 <umain+0x180>
		}
		wait(r);
  80021d:	83 ec 0c             	sub    $0xc,%esp
  800220:	50                   	push   %eax
  800221:	e8 db 20 00 00       	call   802301 <wait>
  800226:	83 c4 10             	add    $0x10,%esp
  800229:	eb ca                	jmp    8001f5 <umain+0x191>

0080022b <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  80022b:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  80022f:	b8 00 00 00 00       	mov    $0x0,%eax
  800234:	c3                   	ret    

00800235 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  800235:	f3 0f 1e fb          	endbr32 
  800239:	55                   	push   %ebp
  80023a:	89 e5                	mov    %esp,%ebp
  80023c:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  80023f:	68 53 28 80 00       	push   $0x802853
  800244:	ff 75 0c             	pushl  0xc(%ebp)
  800247:	e8 a6 08 00 00       	call   800af2 <strcpy>
	return 0;
}
  80024c:	b8 00 00 00 00       	mov    $0x0,%eax
  800251:	c9                   	leave  
  800252:	c3                   	ret    

00800253 <devcons_write>:
{
  800253:	f3 0f 1e fb          	endbr32 
  800257:	55                   	push   %ebp
  800258:	89 e5                	mov    %esp,%ebp
  80025a:	57                   	push   %edi
  80025b:	56                   	push   %esi
  80025c:	53                   	push   %ebx
  80025d:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  800263:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  800268:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  80026e:	3b 75 10             	cmp    0x10(%ebp),%esi
  800271:	73 31                	jae    8002a4 <devcons_write+0x51>
		m = n - tot;
  800273:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800276:	29 f3                	sub    %esi,%ebx
  800278:	83 fb 7f             	cmp    $0x7f,%ebx
  80027b:	b8 7f 00 00 00       	mov    $0x7f,%eax
  800280:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  800283:	83 ec 04             	sub    $0x4,%esp
  800286:	53                   	push   %ebx
  800287:	89 f0                	mov    %esi,%eax
  800289:	03 45 0c             	add    0xc(%ebp),%eax
  80028c:	50                   	push   %eax
  80028d:	57                   	push   %edi
  80028e:	e8 15 0a 00 00       	call   800ca8 <memmove>
		sys_cputs(buf, m);
  800293:	83 c4 08             	add    $0x8,%esp
  800296:	53                   	push   %ebx
  800297:	57                   	push   %edi
  800298:	e8 c7 0b 00 00       	call   800e64 <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  80029d:	01 de                	add    %ebx,%esi
  80029f:	83 c4 10             	add    $0x10,%esp
  8002a2:	eb ca                	jmp    80026e <devcons_write+0x1b>
}
  8002a4:	89 f0                	mov    %esi,%eax
  8002a6:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8002a9:	5b                   	pop    %ebx
  8002aa:	5e                   	pop    %esi
  8002ab:	5f                   	pop    %edi
  8002ac:	5d                   	pop    %ebp
  8002ad:	c3                   	ret    

008002ae <devcons_read>:
{
  8002ae:	f3 0f 1e fb          	endbr32 
  8002b2:	55                   	push   %ebp
  8002b3:	89 e5                	mov    %esp,%ebp
  8002b5:	83 ec 08             	sub    $0x8,%esp
  8002b8:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  8002bd:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8002c1:	74 21                	je     8002e4 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  8002c3:	e8 be 0b 00 00       	call   800e86 <sys_cgetc>
  8002c8:	85 c0                	test   %eax,%eax
  8002ca:	75 07                	jne    8002d3 <devcons_read+0x25>
		sys_yield();
  8002cc:	e8 40 0c 00 00       	call   800f11 <sys_yield>
  8002d1:	eb f0                	jmp    8002c3 <devcons_read+0x15>
	if (c < 0)
  8002d3:	78 0f                	js     8002e4 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  8002d5:	83 f8 04             	cmp    $0x4,%eax
  8002d8:	74 0c                	je     8002e6 <devcons_read+0x38>
	*(char*)vbuf = c;
  8002da:	8b 55 0c             	mov    0xc(%ebp),%edx
  8002dd:	88 02                	mov    %al,(%edx)
	return 1;
  8002df:	b8 01 00 00 00       	mov    $0x1,%eax
}
  8002e4:	c9                   	leave  
  8002e5:	c3                   	ret    
		return 0;
  8002e6:	b8 00 00 00 00       	mov    $0x0,%eax
  8002eb:	eb f7                	jmp    8002e4 <devcons_read+0x36>

008002ed <cputchar>:
{
  8002ed:	f3 0f 1e fb          	endbr32 
  8002f1:	55                   	push   %ebp
  8002f2:	89 e5                	mov    %esp,%ebp
  8002f4:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  8002f7:	8b 45 08             	mov    0x8(%ebp),%eax
  8002fa:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  8002fd:	6a 01                	push   $0x1
  8002ff:	8d 45 f7             	lea    -0x9(%ebp),%eax
  800302:	50                   	push   %eax
  800303:	e8 5c 0b 00 00       	call   800e64 <sys_cputs>
}
  800308:	83 c4 10             	add    $0x10,%esp
  80030b:	c9                   	leave  
  80030c:	c3                   	ret    

0080030d <getchar>:
{
  80030d:	f3 0f 1e fb          	endbr32 
  800311:	55                   	push   %ebp
  800312:	89 e5                	mov    %esp,%ebp
  800314:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  800317:	6a 01                	push   $0x1
  800319:	8d 45 f7             	lea    -0x9(%ebp),%eax
  80031c:	50                   	push   %eax
  80031d:	6a 00                	push   $0x0
  80031f:	e8 29 11 00 00       	call   80144d <read>
	if (r < 0)
  800324:	83 c4 10             	add    $0x10,%esp
  800327:	85 c0                	test   %eax,%eax
  800329:	78 06                	js     800331 <getchar+0x24>
	if (r < 1)
  80032b:	74 06                	je     800333 <getchar+0x26>
	return c;
  80032d:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  800331:	c9                   	leave  
  800332:	c3                   	ret    
		return -E_EOF;
  800333:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  800338:	eb f7                	jmp    800331 <getchar+0x24>

0080033a <iscons>:
{
  80033a:	f3 0f 1e fb          	endbr32 
  80033e:	55                   	push   %ebp
  80033f:	89 e5                	mov    %esp,%ebp
  800341:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800344:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800347:	50                   	push   %eax
  800348:	ff 75 08             	pushl  0x8(%ebp)
  80034b:	e8 7a 0e 00 00       	call   8011ca <fd_lookup>
  800350:	83 c4 10             	add    $0x10,%esp
  800353:	85 c0                	test   %eax,%eax
  800355:	78 11                	js     800368 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  800357:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80035a:	8b 15 70 47 80 00    	mov    0x804770,%edx
  800360:	39 10                	cmp    %edx,(%eax)
  800362:	0f 94 c0             	sete   %al
  800365:	0f b6 c0             	movzbl %al,%eax
}
  800368:	c9                   	leave  
  800369:	c3                   	ret    

0080036a <opencons>:
{
  80036a:	f3 0f 1e fb          	endbr32 
  80036e:	55                   	push   %ebp
  80036f:	89 e5                	mov    %esp,%ebp
  800371:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  800374:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800377:	50                   	push   %eax
  800378:	e8 f7 0d 00 00       	call   801174 <fd_alloc>
  80037d:	83 c4 10             	add    $0x10,%esp
  800380:	85 c0                	test   %eax,%eax
  800382:	78 3a                	js     8003be <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  800384:	83 ec 04             	sub    $0x4,%esp
  800387:	68 07 04 00 00       	push   $0x407
  80038c:	ff 75 f4             	pushl  -0xc(%ebp)
  80038f:	6a 00                	push   $0x0
  800391:	e8 9e 0b 00 00       	call   800f34 <sys_page_alloc>
  800396:	83 c4 10             	add    $0x10,%esp
  800399:	85 c0                	test   %eax,%eax
  80039b:	78 21                	js     8003be <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  80039d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8003a0:	8b 15 70 47 80 00    	mov    0x804770,%edx
  8003a6:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  8003a8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8003ab:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  8003b2:	83 ec 0c             	sub    $0xc,%esp
  8003b5:	50                   	push   %eax
  8003b6:	e8 8a 0d 00 00       	call   801145 <fd2num>
  8003bb:	83 c4 10             	add    $0x10,%esp
}
  8003be:	c9                   	leave  
  8003bf:	c3                   	ret    

008003c0 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8003c0:	f3 0f 1e fb          	endbr32 
  8003c4:	55                   	push   %ebp
  8003c5:	89 e5                	mov    %esp,%ebp
  8003c7:	56                   	push   %esi
  8003c8:	53                   	push   %ebx
  8003c9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8003cc:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8003cf:	c7 05 90 67 80 00 00 	movl   $0x0,0x806790
  8003d6:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8003d9:	e8 10 0b 00 00       	call   800eee <sys_getenvid>
  8003de:	25 ff 03 00 00       	and    $0x3ff,%eax
  8003e3:	6b c0 7c             	imul   $0x7c,%eax,%eax
  8003e6:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  8003eb:	a3 90 67 80 00       	mov    %eax,0x806790

	// save the name of the program so that panic() can use it
	if (argc > 0)
  8003f0:	85 db                	test   %ebx,%ebx
  8003f2:	7e 07                	jle    8003fb <libmain+0x3b>
		binaryname = argv[0];
  8003f4:	8b 06                	mov    (%esi),%eax
  8003f6:	a3 8c 47 80 00       	mov    %eax,0x80478c

	// call user main routine
	umain(argc, argv);
  8003fb:	83 ec 08             	sub    $0x8,%esp
  8003fe:	56                   	push   %esi
  8003ff:	53                   	push   %ebx
  800400:	e8 5f fc ff ff       	call   800064 <umain>

	// exit gracefully
	exit();
  800405:	e8 0a 00 00 00       	call   800414 <exit>
}
  80040a:	83 c4 10             	add    $0x10,%esp
  80040d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800410:	5b                   	pop    %ebx
  800411:	5e                   	pop    %esi
  800412:	5d                   	pop    %ebp
  800413:	c3                   	ret    

00800414 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  800414:	f3 0f 1e fb          	endbr32 
  800418:	55                   	push   %ebp
  800419:	89 e5                	mov    %esp,%ebp
  80041b:	83 ec 08             	sub    $0x8,%esp
	close_all();
  80041e:	e8 11 0f 00 00       	call   801334 <close_all>
	sys_env_destroy(0);
  800423:	83 ec 0c             	sub    $0xc,%esp
  800426:	6a 00                	push   $0x0
  800428:	e8 7c 0a 00 00       	call   800ea9 <sys_env_destroy>
}
  80042d:	83 c4 10             	add    $0x10,%esp
  800430:	c9                   	leave  
  800431:	c3                   	ret    

00800432 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  800432:	f3 0f 1e fb          	endbr32 
  800436:	55                   	push   %ebp
  800437:	89 e5                	mov    %esp,%ebp
  800439:	56                   	push   %esi
  80043a:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  80043b:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  80043e:	8b 35 8c 47 80 00    	mov    0x80478c,%esi
  800444:	e8 a5 0a 00 00       	call   800eee <sys_getenvid>
  800449:	83 ec 0c             	sub    $0xc,%esp
  80044c:	ff 75 0c             	pushl  0xc(%ebp)
  80044f:	ff 75 08             	pushl  0x8(%ebp)
  800452:	56                   	push   %esi
  800453:	50                   	push   %eax
  800454:	68 6c 28 80 00       	push   $0x80286c
  800459:	e8 bb 00 00 00       	call   800519 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  80045e:	83 c4 18             	add    $0x18,%esp
  800461:	53                   	push   %ebx
  800462:	ff 75 10             	pushl  0x10(%ebp)
  800465:	e8 5a 00 00 00       	call   8004c4 <vcprintf>
	cprintf("\n");
  80046a:	c7 04 24 3e 2d 80 00 	movl   $0x802d3e,(%esp)
  800471:	e8 a3 00 00 00       	call   800519 <cprintf>
  800476:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  800479:	cc                   	int3   
  80047a:	eb fd                	jmp    800479 <_panic+0x47>

0080047c <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  80047c:	f3 0f 1e fb          	endbr32 
  800480:	55                   	push   %ebp
  800481:	89 e5                	mov    %esp,%ebp
  800483:	53                   	push   %ebx
  800484:	83 ec 04             	sub    $0x4,%esp
  800487:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  80048a:	8b 13                	mov    (%ebx),%edx
  80048c:	8d 42 01             	lea    0x1(%edx),%eax
  80048f:	89 03                	mov    %eax,(%ebx)
  800491:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800494:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  800498:	3d ff 00 00 00       	cmp    $0xff,%eax
  80049d:	74 09                	je     8004a8 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  80049f:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8004a3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8004a6:	c9                   	leave  
  8004a7:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8004a8:	83 ec 08             	sub    $0x8,%esp
  8004ab:	68 ff 00 00 00       	push   $0xff
  8004b0:	8d 43 08             	lea    0x8(%ebx),%eax
  8004b3:	50                   	push   %eax
  8004b4:	e8 ab 09 00 00       	call   800e64 <sys_cputs>
		b->idx = 0;
  8004b9:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8004bf:	83 c4 10             	add    $0x10,%esp
  8004c2:	eb db                	jmp    80049f <putch+0x23>

008004c4 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8004c4:	f3 0f 1e fb          	endbr32 
  8004c8:	55                   	push   %ebp
  8004c9:	89 e5                	mov    %esp,%ebp
  8004cb:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8004d1:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8004d8:	00 00 00 
	b.cnt = 0;
  8004db:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  8004e2:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  8004e5:	ff 75 0c             	pushl  0xc(%ebp)
  8004e8:	ff 75 08             	pushl  0x8(%ebp)
  8004eb:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  8004f1:	50                   	push   %eax
  8004f2:	68 7c 04 80 00       	push   $0x80047c
  8004f7:	e8 20 01 00 00       	call   80061c <vprintfmt>
	sys_cputs(b.buf, b.idx);
  8004fc:	83 c4 08             	add    $0x8,%esp
  8004ff:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  800505:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  80050b:	50                   	push   %eax
  80050c:	e8 53 09 00 00       	call   800e64 <sys_cputs>

	return b.cnt;
}
  800511:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800517:	c9                   	leave  
  800518:	c3                   	ret    

00800519 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800519:	f3 0f 1e fb          	endbr32 
  80051d:	55                   	push   %ebp
  80051e:	89 e5                	mov    %esp,%ebp
  800520:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  800523:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  800526:	50                   	push   %eax
  800527:	ff 75 08             	pushl  0x8(%ebp)
  80052a:	e8 95 ff ff ff       	call   8004c4 <vcprintf>
	va_end(ap);

	return cnt;
}
  80052f:	c9                   	leave  
  800530:	c3                   	ret    

00800531 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800531:	55                   	push   %ebp
  800532:	89 e5                	mov    %esp,%ebp
  800534:	57                   	push   %edi
  800535:	56                   	push   %esi
  800536:	53                   	push   %ebx
  800537:	83 ec 1c             	sub    $0x1c,%esp
  80053a:	89 c7                	mov    %eax,%edi
  80053c:	89 d6                	mov    %edx,%esi
  80053e:	8b 45 08             	mov    0x8(%ebp),%eax
  800541:	8b 55 0c             	mov    0xc(%ebp),%edx
  800544:	89 d1                	mov    %edx,%ecx
  800546:	89 c2                	mov    %eax,%edx
  800548:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80054b:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80054e:	8b 45 10             	mov    0x10(%ebp),%eax
  800551:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  800554:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800557:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  80055e:	39 c2                	cmp    %eax,%edx
  800560:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  800563:	72 3e                	jb     8005a3 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  800565:	83 ec 0c             	sub    $0xc,%esp
  800568:	ff 75 18             	pushl  0x18(%ebp)
  80056b:	83 eb 01             	sub    $0x1,%ebx
  80056e:	53                   	push   %ebx
  80056f:	50                   	push   %eax
  800570:	83 ec 08             	sub    $0x8,%esp
  800573:	ff 75 e4             	pushl  -0x1c(%ebp)
  800576:	ff 75 e0             	pushl  -0x20(%ebp)
  800579:	ff 75 dc             	pushl  -0x24(%ebp)
  80057c:	ff 75 d8             	pushl  -0x28(%ebp)
  80057f:	e8 2c 1f 00 00       	call   8024b0 <__udivdi3>
  800584:	83 c4 18             	add    $0x18,%esp
  800587:	52                   	push   %edx
  800588:	50                   	push   %eax
  800589:	89 f2                	mov    %esi,%edx
  80058b:	89 f8                	mov    %edi,%eax
  80058d:	e8 9f ff ff ff       	call   800531 <printnum>
  800592:	83 c4 20             	add    $0x20,%esp
  800595:	eb 13                	jmp    8005aa <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  800597:	83 ec 08             	sub    $0x8,%esp
  80059a:	56                   	push   %esi
  80059b:	ff 75 18             	pushl  0x18(%ebp)
  80059e:	ff d7                	call   *%edi
  8005a0:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8005a3:	83 eb 01             	sub    $0x1,%ebx
  8005a6:	85 db                	test   %ebx,%ebx
  8005a8:	7f ed                	jg     800597 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8005aa:	83 ec 08             	sub    $0x8,%esp
  8005ad:	56                   	push   %esi
  8005ae:	83 ec 04             	sub    $0x4,%esp
  8005b1:	ff 75 e4             	pushl  -0x1c(%ebp)
  8005b4:	ff 75 e0             	pushl  -0x20(%ebp)
  8005b7:	ff 75 dc             	pushl  -0x24(%ebp)
  8005ba:	ff 75 d8             	pushl  -0x28(%ebp)
  8005bd:	e8 fe 1f 00 00       	call   8025c0 <__umoddi3>
  8005c2:	83 c4 14             	add    $0x14,%esp
  8005c5:	0f be 80 8f 28 80 00 	movsbl 0x80288f(%eax),%eax
  8005cc:	50                   	push   %eax
  8005cd:	ff d7                	call   *%edi
}
  8005cf:	83 c4 10             	add    $0x10,%esp
  8005d2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8005d5:	5b                   	pop    %ebx
  8005d6:	5e                   	pop    %esi
  8005d7:	5f                   	pop    %edi
  8005d8:	5d                   	pop    %ebp
  8005d9:	c3                   	ret    

008005da <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8005da:	f3 0f 1e fb          	endbr32 
  8005de:	55                   	push   %ebp
  8005df:	89 e5                	mov    %esp,%ebp
  8005e1:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  8005e4:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  8005e8:	8b 10                	mov    (%eax),%edx
  8005ea:	3b 50 04             	cmp    0x4(%eax),%edx
  8005ed:	73 0a                	jae    8005f9 <sprintputch+0x1f>
		*b->buf++ = ch;
  8005ef:	8d 4a 01             	lea    0x1(%edx),%ecx
  8005f2:	89 08                	mov    %ecx,(%eax)
  8005f4:	8b 45 08             	mov    0x8(%ebp),%eax
  8005f7:	88 02                	mov    %al,(%edx)
}
  8005f9:	5d                   	pop    %ebp
  8005fa:	c3                   	ret    

008005fb <printfmt>:
{
  8005fb:	f3 0f 1e fb          	endbr32 
  8005ff:	55                   	push   %ebp
  800600:	89 e5                	mov    %esp,%ebp
  800602:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  800605:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800608:	50                   	push   %eax
  800609:	ff 75 10             	pushl  0x10(%ebp)
  80060c:	ff 75 0c             	pushl  0xc(%ebp)
  80060f:	ff 75 08             	pushl  0x8(%ebp)
  800612:	e8 05 00 00 00       	call   80061c <vprintfmt>
}
  800617:	83 c4 10             	add    $0x10,%esp
  80061a:	c9                   	leave  
  80061b:	c3                   	ret    

0080061c <vprintfmt>:
{
  80061c:	f3 0f 1e fb          	endbr32 
  800620:	55                   	push   %ebp
  800621:	89 e5                	mov    %esp,%ebp
  800623:	57                   	push   %edi
  800624:	56                   	push   %esi
  800625:	53                   	push   %ebx
  800626:	83 ec 3c             	sub    $0x3c,%esp
  800629:	8b 75 08             	mov    0x8(%ebp),%esi
  80062c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  80062f:	8b 7d 10             	mov    0x10(%ebp),%edi
  800632:	e9 5d 03 00 00       	jmp    800994 <vprintfmt+0x378>
		padc = ' ';
  800637:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  80063b:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  800642:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  800649:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  800650:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800655:	8d 47 01             	lea    0x1(%edi),%eax
  800658:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80065b:	0f b6 17             	movzbl (%edi),%edx
  80065e:	8d 42 dd             	lea    -0x23(%edx),%eax
  800661:	3c 55                	cmp    $0x55,%al
  800663:	0f 87 ae 03 00 00    	ja     800a17 <vprintfmt+0x3fb>
  800669:	0f b6 c0             	movzbl %al,%eax
  80066c:	3e ff 24 85 e0 29 80 	notrack jmp *0x8029e0(,%eax,4)
  800673:	00 
  800674:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  800677:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  80067b:	eb d8                	jmp    800655 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  80067d:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  800680:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  800684:	eb cf                	jmp    800655 <vprintfmt+0x39>
  800686:	0f b6 d2             	movzbl %dl,%edx
  800689:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  80068c:	b8 00 00 00 00       	mov    $0x0,%eax
  800691:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  800694:	8d 04 80             	lea    (%eax,%eax,4),%eax
  800697:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  80069b:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  80069e:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8006a1:	83 f9 09             	cmp    $0x9,%ecx
  8006a4:	77 55                	ja     8006fb <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8006a6:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8006a9:	eb e9                	jmp    800694 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8006ab:	8b 45 14             	mov    0x14(%ebp),%eax
  8006ae:	8b 00                	mov    (%eax),%eax
  8006b0:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8006b3:	8b 45 14             	mov    0x14(%ebp),%eax
  8006b6:	8d 40 04             	lea    0x4(%eax),%eax
  8006b9:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8006bc:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8006bf:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8006c3:	79 90                	jns    800655 <vprintfmt+0x39>
				width = precision, precision = -1;
  8006c5:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8006c8:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8006cb:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8006d2:	eb 81                	jmp    800655 <vprintfmt+0x39>
  8006d4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8006d7:	85 c0                	test   %eax,%eax
  8006d9:	ba 00 00 00 00       	mov    $0x0,%edx
  8006de:	0f 49 d0             	cmovns %eax,%edx
  8006e1:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8006e4:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8006e7:	e9 69 ff ff ff       	jmp    800655 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8006ec:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  8006ef:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  8006f6:	e9 5a ff ff ff       	jmp    800655 <vprintfmt+0x39>
  8006fb:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  8006fe:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800701:	eb bc                	jmp    8006bf <vprintfmt+0xa3>
			lflag++;
  800703:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800706:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800709:	e9 47 ff ff ff       	jmp    800655 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  80070e:	8b 45 14             	mov    0x14(%ebp),%eax
  800711:	8d 78 04             	lea    0x4(%eax),%edi
  800714:	83 ec 08             	sub    $0x8,%esp
  800717:	53                   	push   %ebx
  800718:	ff 30                	pushl  (%eax)
  80071a:	ff d6                	call   *%esi
			break;
  80071c:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  80071f:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  800722:	e9 6a 02 00 00       	jmp    800991 <vprintfmt+0x375>
			err = va_arg(ap, int);
  800727:	8b 45 14             	mov    0x14(%ebp),%eax
  80072a:	8d 78 04             	lea    0x4(%eax),%edi
  80072d:	8b 00                	mov    (%eax),%eax
  80072f:	99                   	cltd   
  800730:	31 d0                	xor    %edx,%eax
  800732:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  800734:	83 f8 0f             	cmp    $0xf,%eax
  800737:	7f 23                	jg     80075c <vprintfmt+0x140>
  800739:	8b 14 85 40 2b 80 00 	mov    0x802b40(,%eax,4),%edx
  800740:	85 d2                	test   %edx,%edx
  800742:	74 18                	je     80075c <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  800744:	52                   	push   %edx
  800745:	68 71 2c 80 00       	push   $0x802c71
  80074a:	53                   	push   %ebx
  80074b:	56                   	push   %esi
  80074c:	e8 aa fe ff ff       	call   8005fb <printfmt>
  800751:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800754:	89 7d 14             	mov    %edi,0x14(%ebp)
  800757:	e9 35 02 00 00       	jmp    800991 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  80075c:	50                   	push   %eax
  80075d:	68 a7 28 80 00       	push   $0x8028a7
  800762:	53                   	push   %ebx
  800763:	56                   	push   %esi
  800764:	e8 92 fe ff ff       	call   8005fb <printfmt>
  800769:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80076c:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  80076f:	e9 1d 02 00 00       	jmp    800991 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  800774:	8b 45 14             	mov    0x14(%ebp),%eax
  800777:	83 c0 04             	add    $0x4,%eax
  80077a:	89 45 c8             	mov    %eax,-0x38(%ebp)
  80077d:	8b 45 14             	mov    0x14(%ebp),%eax
  800780:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  800782:	85 d2                	test   %edx,%edx
  800784:	b8 a0 28 80 00       	mov    $0x8028a0,%eax
  800789:	0f 45 c2             	cmovne %edx,%eax
  80078c:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  80078f:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  800793:	7e 06                	jle    80079b <vprintfmt+0x17f>
  800795:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  800799:	75 0d                	jne    8007a8 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  80079b:	8b 45 cc             	mov    -0x34(%ebp),%eax
  80079e:	89 c7                	mov    %eax,%edi
  8007a0:	03 45 d4             	add    -0x2c(%ebp),%eax
  8007a3:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8007a6:	eb 55                	jmp    8007fd <vprintfmt+0x1e1>
  8007a8:	83 ec 08             	sub    $0x8,%esp
  8007ab:	ff 75 d8             	pushl  -0x28(%ebp)
  8007ae:	ff 75 cc             	pushl  -0x34(%ebp)
  8007b1:	e8 15 03 00 00       	call   800acb <strnlen>
  8007b6:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  8007b9:	29 c2                	sub    %eax,%edx
  8007bb:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8007be:	83 c4 10             	add    $0x10,%esp
  8007c1:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8007c3:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8007c7:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8007ca:	85 ff                	test   %edi,%edi
  8007cc:	7e 11                	jle    8007df <vprintfmt+0x1c3>
					putch(padc, putdat);
  8007ce:	83 ec 08             	sub    $0x8,%esp
  8007d1:	53                   	push   %ebx
  8007d2:	ff 75 d4             	pushl  -0x2c(%ebp)
  8007d5:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8007d7:	83 ef 01             	sub    $0x1,%edi
  8007da:	83 c4 10             	add    $0x10,%esp
  8007dd:	eb eb                	jmp    8007ca <vprintfmt+0x1ae>
  8007df:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  8007e2:	85 d2                	test   %edx,%edx
  8007e4:	b8 00 00 00 00       	mov    $0x0,%eax
  8007e9:	0f 49 c2             	cmovns %edx,%eax
  8007ec:	29 c2                	sub    %eax,%edx
  8007ee:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  8007f1:	eb a8                	jmp    80079b <vprintfmt+0x17f>
					putch(ch, putdat);
  8007f3:	83 ec 08             	sub    $0x8,%esp
  8007f6:	53                   	push   %ebx
  8007f7:	52                   	push   %edx
  8007f8:	ff d6                	call   *%esi
  8007fa:	83 c4 10             	add    $0x10,%esp
  8007fd:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800800:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800802:	83 c7 01             	add    $0x1,%edi
  800805:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800809:	0f be d0             	movsbl %al,%edx
  80080c:	85 d2                	test   %edx,%edx
  80080e:	74 4b                	je     80085b <vprintfmt+0x23f>
  800810:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  800814:	78 06                	js     80081c <vprintfmt+0x200>
  800816:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  80081a:	78 1e                	js     80083a <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  80081c:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800820:	74 d1                	je     8007f3 <vprintfmt+0x1d7>
  800822:	0f be c0             	movsbl %al,%eax
  800825:	83 e8 20             	sub    $0x20,%eax
  800828:	83 f8 5e             	cmp    $0x5e,%eax
  80082b:	76 c6                	jbe    8007f3 <vprintfmt+0x1d7>
					putch('?', putdat);
  80082d:	83 ec 08             	sub    $0x8,%esp
  800830:	53                   	push   %ebx
  800831:	6a 3f                	push   $0x3f
  800833:	ff d6                	call   *%esi
  800835:	83 c4 10             	add    $0x10,%esp
  800838:	eb c3                	jmp    8007fd <vprintfmt+0x1e1>
  80083a:	89 cf                	mov    %ecx,%edi
  80083c:	eb 0e                	jmp    80084c <vprintfmt+0x230>
				putch(' ', putdat);
  80083e:	83 ec 08             	sub    $0x8,%esp
  800841:	53                   	push   %ebx
  800842:	6a 20                	push   $0x20
  800844:	ff d6                	call   *%esi
			for (; width > 0; width--)
  800846:	83 ef 01             	sub    $0x1,%edi
  800849:	83 c4 10             	add    $0x10,%esp
  80084c:	85 ff                	test   %edi,%edi
  80084e:	7f ee                	jg     80083e <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  800850:	8b 45 c8             	mov    -0x38(%ebp),%eax
  800853:	89 45 14             	mov    %eax,0x14(%ebp)
  800856:	e9 36 01 00 00       	jmp    800991 <vprintfmt+0x375>
  80085b:	89 cf                	mov    %ecx,%edi
  80085d:	eb ed                	jmp    80084c <vprintfmt+0x230>
	if (lflag >= 2)
  80085f:	83 f9 01             	cmp    $0x1,%ecx
  800862:	7f 1f                	jg     800883 <vprintfmt+0x267>
	else if (lflag)
  800864:	85 c9                	test   %ecx,%ecx
  800866:	74 67                	je     8008cf <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  800868:	8b 45 14             	mov    0x14(%ebp),%eax
  80086b:	8b 00                	mov    (%eax),%eax
  80086d:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800870:	89 c1                	mov    %eax,%ecx
  800872:	c1 f9 1f             	sar    $0x1f,%ecx
  800875:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800878:	8b 45 14             	mov    0x14(%ebp),%eax
  80087b:	8d 40 04             	lea    0x4(%eax),%eax
  80087e:	89 45 14             	mov    %eax,0x14(%ebp)
  800881:	eb 17                	jmp    80089a <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  800883:	8b 45 14             	mov    0x14(%ebp),%eax
  800886:	8b 50 04             	mov    0x4(%eax),%edx
  800889:	8b 00                	mov    (%eax),%eax
  80088b:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80088e:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800891:	8b 45 14             	mov    0x14(%ebp),%eax
  800894:	8d 40 08             	lea    0x8(%eax),%eax
  800897:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  80089a:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80089d:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8008a0:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8008a5:	85 c9                	test   %ecx,%ecx
  8008a7:	0f 89 ca 00 00 00    	jns    800977 <vprintfmt+0x35b>
				putch('-', putdat);
  8008ad:	83 ec 08             	sub    $0x8,%esp
  8008b0:	53                   	push   %ebx
  8008b1:	6a 2d                	push   $0x2d
  8008b3:	ff d6                	call   *%esi
				num = -(long long) num;
  8008b5:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8008b8:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8008bb:	f7 da                	neg    %edx
  8008bd:	83 d1 00             	adc    $0x0,%ecx
  8008c0:	f7 d9                	neg    %ecx
  8008c2:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8008c5:	b8 0a 00 00 00       	mov    $0xa,%eax
  8008ca:	e9 a8 00 00 00       	jmp    800977 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8008cf:	8b 45 14             	mov    0x14(%ebp),%eax
  8008d2:	8b 00                	mov    (%eax),%eax
  8008d4:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8008d7:	99                   	cltd   
  8008d8:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8008db:	8b 45 14             	mov    0x14(%ebp),%eax
  8008de:	8d 40 04             	lea    0x4(%eax),%eax
  8008e1:	89 45 14             	mov    %eax,0x14(%ebp)
  8008e4:	eb b4                	jmp    80089a <vprintfmt+0x27e>
	if (lflag >= 2)
  8008e6:	83 f9 01             	cmp    $0x1,%ecx
  8008e9:	7f 1b                	jg     800906 <vprintfmt+0x2ea>
	else if (lflag)
  8008eb:	85 c9                	test   %ecx,%ecx
  8008ed:	74 2c                	je     80091b <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  8008ef:	8b 45 14             	mov    0x14(%ebp),%eax
  8008f2:	8b 10                	mov    (%eax),%edx
  8008f4:	b9 00 00 00 00       	mov    $0x0,%ecx
  8008f9:	8d 40 04             	lea    0x4(%eax),%eax
  8008fc:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8008ff:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  800904:	eb 71                	jmp    800977 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800906:	8b 45 14             	mov    0x14(%ebp),%eax
  800909:	8b 10                	mov    (%eax),%edx
  80090b:	8b 48 04             	mov    0x4(%eax),%ecx
  80090e:	8d 40 08             	lea    0x8(%eax),%eax
  800911:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800914:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800919:	eb 5c                	jmp    800977 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  80091b:	8b 45 14             	mov    0x14(%ebp),%eax
  80091e:	8b 10                	mov    (%eax),%edx
  800920:	b9 00 00 00 00       	mov    $0x0,%ecx
  800925:	8d 40 04             	lea    0x4(%eax),%eax
  800928:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80092b:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800930:	eb 45                	jmp    800977 <vprintfmt+0x35b>
			putch('X', putdat);
  800932:	83 ec 08             	sub    $0x8,%esp
  800935:	53                   	push   %ebx
  800936:	6a 58                	push   $0x58
  800938:	ff d6                	call   *%esi
			putch('X', putdat);
  80093a:	83 c4 08             	add    $0x8,%esp
  80093d:	53                   	push   %ebx
  80093e:	6a 58                	push   $0x58
  800940:	ff d6                	call   *%esi
			putch('X', putdat);
  800942:	83 c4 08             	add    $0x8,%esp
  800945:	53                   	push   %ebx
  800946:	6a 58                	push   $0x58
  800948:	ff d6                	call   *%esi
			break;
  80094a:	83 c4 10             	add    $0x10,%esp
  80094d:	eb 42                	jmp    800991 <vprintfmt+0x375>
			putch('0', putdat);
  80094f:	83 ec 08             	sub    $0x8,%esp
  800952:	53                   	push   %ebx
  800953:	6a 30                	push   $0x30
  800955:	ff d6                	call   *%esi
			putch('x', putdat);
  800957:	83 c4 08             	add    $0x8,%esp
  80095a:	53                   	push   %ebx
  80095b:	6a 78                	push   $0x78
  80095d:	ff d6                	call   *%esi
			num = (unsigned long long)
  80095f:	8b 45 14             	mov    0x14(%ebp),%eax
  800962:	8b 10                	mov    (%eax),%edx
  800964:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  800969:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  80096c:	8d 40 04             	lea    0x4(%eax),%eax
  80096f:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800972:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  800977:	83 ec 0c             	sub    $0xc,%esp
  80097a:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  80097e:	57                   	push   %edi
  80097f:	ff 75 d4             	pushl  -0x2c(%ebp)
  800982:	50                   	push   %eax
  800983:	51                   	push   %ecx
  800984:	52                   	push   %edx
  800985:	89 da                	mov    %ebx,%edx
  800987:	89 f0                	mov    %esi,%eax
  800989:	e8 a3 fb ff ff       	call   800531 <printnum>
			break;
  80098e:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  800991:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  800994:	83 c7 01             	add    $0x1,%edi
  800997:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80099b:	83 f8 25             	cmp    $0x25,%eax
  80099e:	0f 84 93 fc ff ff    	je     800637 <vprintfmt+0x1b>
			if (ch == '\0')
  8009a4:	85 c0                	test   %eax,%eax
  8009a6:	0f 84 8b 00 00 00    	je     800a37 <vprintfmt+0x41b>
			putch(ch, putdat);
  8009ac:	83 ec 08             	sub    $0x8,%esp
  8009af:	53                   	push   %ebx
  8009b0:	50                   	push   %eax
  8009b1:	ff d6                	call   *%esi
  8009b3:	83 c4 10             	add    $0x10,%esp
  8009b6:	eb dc                	jmp    800994 <vprintfmt+0x378>
	if (lflag >= 2)
  8009b8:	83 f9 01             	cmp    $0x1,%ecx
  8009bb:	7f 1b                	jg     8009d8 <vprintfmt+0x3bc>
	else if (lflag)
  8009bd:	85 c9                	test   %ecx,%ecx
  8009bf:	74 2c                	je     8009ed <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  8009c1:	8b 45 14             	mov    0x14(%ebp),%eax
  8009c4:	8b 10                	mov    (%eax),%edx
  8009c6:	b9 00 00 00 00       	mov    $0x0,%ecx
  8009cb:	8d 40 04             	lea    0x4(%eax),%eax
  8009ce:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8009d1:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  8009d6:	eb 9f                	jmp    800977 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8009d8:	8b 45 14             	mov    0x14(%ebp),%eax
  8009db:	8b 10                	mov    (%eax),%edx
  8009dd:	8b 48 04             	mov    0x4(%eax),%ecx
  8009e0:	8d 40 08             	lea    0x8(%eax),%eax
  8009e3:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8009e6:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  8009eb:	eb 8a                	jmp    800977 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  8009ed:	8b 45 14             	mov    0x14(%ebp),%eax
  8009f0:	8b 10                	mov    (%eax),%edx
  8009f2:	b9 00 00 00 00       	mov    $0x0,%ecx
  8009f7:	8d 40 04             	lea    0x4(%eax),%eax
  8009fa:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8009fd:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  800a02:	e9 70 ff ff ff       	jmp    800977 <vprintfmt+0x35b>
			putch(ch, putdat);
  800a07:	83 ec 08             	sub    $0x8,%esp
  800a0a:	53                   	push   %ebx
  800a0b:	6a 25                	push   $0x25
  800a0d:	ff d6                	call   *%esi
			break;
  800a0f:	83 c4 10             	add    $0x10,%esp
  800a12:	e9 7a ff ff ff       	jmp    800991 <vprintfmt+0x375>
			putch('%', putdat);
  800a17:	83 ec 08             	sub    $0x8,%esp
  800a1a:	53                   	push   %ebx
  800a1b:	6a 25                	push   $0x25
  800a1d:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800a1f:	83 c4 10             	add    $0x10,%esp
  800a22:	89 f8                	mov    %edi,%eax
  800a24:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800a28:	74 05                	je     800a2f <vprintfmt+0x413>
  800a2a:	83 e8 01             	sub    $0x1,%eax
  800a2d:	eb f5                	jmp    800a24 <vprintfmt+0x408>
  800a2f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800a32:	e9 5a ff ff ff       	jmp    800991 <vprintfmt+0x375>
}
  800a37:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800a3a:	5b                   	pop    %ebx
  800a3b:	5e                   	pop    %esi
  800a3c:	5f                   	pop    %edi
  800a3d:	5d                   	pop    %ebp
  800a3e:	c3                   	ret    

00800a3f <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800a3f:	f3 0f 1e fb          	endbr32 
  800a43:	55                   	push   %ebp
  800a44:	89 e5                	mov    %esp,%ebp
  800a46:	83 ec 18             	sub    $0x18,%esp
  800a49:	8b 45 08             	mov    0x8(%ebp),%eax
  800a4c:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  800a4f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  800a52:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  800a56:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  800a59:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  800a60:	85 c0                	test   %eax,%eax
  800a62:	74 26                	je     800a8a <vsnprintf+0x4b>
  800a64:	85 d2                	test   %edx,%edx
  800a66:	7e 22                	jle    800a8a <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  800a68:	ff 75 14             	pushl  0x14(%ebp)
  800a6b:	ff 75 10             	pushl  0x10(%ebp)
  800a6e:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800a71:	50                   	push   %eax
  800a72:	68 da 05 80 00       	push   $0x8005da
  800a77:	e8 a0 fb ff ff       	call   80061c <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  800a7c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800a7f:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  800a82:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800a85:	83 c4 10             	add    $0x10,%esp
}
  800a88:	c9                   	leave  
  800a89:	c3                   	ret    
		return -E_INVAL;
  800a8a:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800a8f:	eb f7                	jmp    800a88 <vsnprintf+0x49>

00800a91 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  800a91:	f3 0f 1e fb          	endbr32 
  800a95:	55                   	push   %ebp
  800a96:	89 e5                	mov    %esp,%ebp
  800a98:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  800a9b:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800a9e:	50                   	push   %eax
  800a9f:	ff 75 10             	pushl  0x10(%ebp)
  800aa2:	ff 75 0c             	pushl  0xc(%ebp)
  800aa5:	ff 75 08             	pushl  0x8(%ebp)
  800aa8:	e8 92 ff ff ff       	call   800a3f <vsnprintf>
	va_end(ap);

	return rc;
}
  800aad:	c9                   	leave  
  800aae:	c3                   	ret    

00800aaf <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800aaf:	f3 0f 1e fb          	endbr32 
  800ab3:	55                   	push   %ebp
  800ab4:	89 e5                	mov    %esp,%ebp
  800ab6:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800ab9:	b8 00 00 00 00       	mov    $0x0,%eax
  800abe:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  800ac2:	74 05                	je     800ac9 <strlen+0x1a>
		n++;
  800ac4:	83 c0 01             	add    $0x1,%eax
  800ac7:	eb f5                	jmp    800abe <strlen+0xf>
	return n;
}
  800ac9:	5d                   	pop    %ebp
  800aca:	c3                   	ret    

00800acb <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800acb:	f3 0f 1e fb          	endbr32 
  800acf:	55                   	push   %ebp
  800ad0:	89 e5                	mov    %esp,%ebp
  800ad2:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ad5:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800ad8:	b8 00 00 00 00       	mov    $0x0,%eax
  800add:	39 d0                	cmp    %edx,%eax
  800adf:	74 0d                	je     800aee <strnlen+0x23>
  800ae1:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  800ae5:	74 05                	je     800aec <strnlen+0x21>
		n++;
  800ae7:	83 c0 01             	add    $0x1,%eax
  800aea:	eb f1                	jmp    800add <strnlen+0x12>
  800aec:	89 c2                	mov    %eax,%edx
	return n;
}
  800aee:	89 d0                	mov    %edx,%eax
  800af0:	5d                   	pop    %ebp
  800af1:	c3                   	ret    

00800af2 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800af2:	f3 0f 1e fb          	endbr32 
  800af6:	55                   	push   %ebp
  800af7:	89 e5                	mov    %esp,%ebp
  800af9:	53                   	push   %ebx
  800afa:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800afd:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800b00:	b8 00 00 00 00       	mov    $0x0,%eax
  800b05:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800b09:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800b0c:	83 c0 01             	add    $0x1,%eax
  800b0f:	84 d2                	test   %dl,%dl
  800b11:	75 f2                	jne    800b05 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  800b13:	89 c8                	mov    %ecx,%eax
  800b15:	5b                   	pop    %ebx
  800b16:	5d                   	pop    %ebp
  800b17:	c3                   	ret    

00800b18 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800b18:	f3 0f 1e fb          	endbr32 
  800b1c:	55                   	push   %ebp
  800b1d:	89 e5                	mov    %esp,%ebp
  800b1f:	53                   	push   %ebx
  800b20:	83 ec 10             	sub    $0x10,%esp
  800b23:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  800b26:	53                   	push   %ebx
  800b27:	e8 83 ff ff ff       	call   800aaf <strlen>
  800b2c:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800b2f:	ff 75 0c             	pushl  0xc(%ebp)
  800b32:	01 d8                	add    %ebx,%eax
  800b34:	50                   	push   %eax
  800b35:	e8 b8 ff ff ff       	call   800af2 <strcpy>
	return dst;
}
  800b3a:	89 d8                	mov    %ebx,%eax
  800b3c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800b3f:	c9                   	leave  
  800b40:	c3                   	ret    

00800b41 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800b41:	f3 0f 1e fb          	endbr32 
  800b45:	55                   	push   %ebp
  800b46:	89 e5                	mov    %esp,%ebp
  800b48:	56                   	push   %esi
  800b49:	53                   	push   %ebx
  800b4a:	8b 75 08             	mov    0x8(%ebp),%esi
  800b4d:	8b 55 0c             	mov    0xc(%ebp),%edx
  800b50:	89 f3                	mov    %esi,%ebx
  800b52:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  800b55:	89 f0                	mov    %esi,%eax
  800b57:	39 d8                	cmp    %ebx,%eax
  800b59:	74 11                	je     800b6c <strncpy+0x2b>
		*dst++ = *src;
  800b5b:	83 c0 01             	add    $0x1,%eax
  800b5e:	0f b6 0a             	movzbl (%edx),%ecx
  800b61:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  800b64:	80 f9 01             	cmp    $0x1,%cl
  800b67:	83 da ff             	sbb    $0xffffffff,%edx
  800b6a:	eb eb                	jmp    800b57 <strncpy+0x16>
	}
	return ret;
}
  800b6c:	89 f0                	mov    %esi,%eax
  800b6e:	5b                   	pop    %ebx
  800b6f:	5e                   	pop    %esi
  800b70:	5d                   	pop    %ebp
  800b71:	c3                   	ret    

00800b72 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  800b72:	f3 0f 1e fb          	endbr32 
  800b76:	55                   	push   %ebp
  800b77:	89 e5                	mov    %esp,%ebp
  800b79:	56                   	push   %esi
  800b7a:	53                   	push   %ebx
  800b7b:	8b 75 08             	mov    0x8(%ebp),%esi
  800b7e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b81:	8b 55 10             	mov    0x10(%ebp),%edx
  800b84:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  800b86:	85 d2                	test   %edx,%edx
  800b88:	74 21                	je     800bab <strlcpy+0x39>
  800b8a:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800b8e:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  800b90:	39 c2                	cmp    %eax,%edx
  800b92:	74 14                	je     800ba8 <strlcpy+0x36>
  800b94:	0f b6 19             	movzbl (%ecx),%ebx
  800b97:	84 db                	test   %bl,%bl
  800b99:	74 0b                	je     800ba6 <strlcpy+0x34>
			*dst++ = *src++;
  800b9b:	83 c1 01             	add    $0x1,%ecx
  800b9e:	83 c2 01             	add    $0x1,%edx
  800ba1:	88 5a ff             	mov    %bl,-0x1(%edx)
  800ba4:	eb ea                	jmp    800b90 <strlcpy+0x1e>
  800ba6:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800ba8:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800bab:	29 f0                	sub    %esi,%eax
}
  800bad:	5b                   	pop    %ebx
  800bae:	5e                   	pop    %esi
  800baf:	5d                   	pop    %ebp
  800bb0:	c3                   	ret    

00800bb1 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800bb1:	f3 0f 1e fb          	endbr32 
  800bb5:	55                   	push   %ebp
  800bb6:	89 e5                	mov    %esp,%ebp
  800bb8:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800bbb:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800bbe:	0f b6 01             	movzbl (%ecx),%eax
  800bc1:	84 c0                	test   %al,%al
  800bc3:	74 0c                	je     800bd1 <strcmp+0x20>
  800bc5:	3a 02                	cmp    (%edx),%al
  800bc7:	75 08                	jne    800bd1 <strcmp+0x20>
		p++, q++;
  800bc9:	83 c1 01             	add    $0x1,%ecx
  800bcc:	83 c2 01             	add    $0x1,%edx
  800bcf:	eb ed                	jmp    800bbe <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800bd1:	0f b6 c0             	movzbl %al,%eax
  800bd4:	0f b6 12             	movzbl (%edx),%edx
  800bd7:	29 d0                	sub    %edx,%eax
}
  800bd9:	5d                   	pop    %ebp
  800bda:	c3                   	ret    

00800bdb <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800bdb:	f3 0f 1e fb          	endbr32 
  800bdf:	55                   	push   %ebp
  800be0:	89 e5                	mov    %esp,%ebp
  800be2:	53                   	push   %ebx
  800be3:	8b 45 08             	mov    0x8(%ebp),%eax
  800be6:	8b 55 0c             	mov    0xc(%ebp),%edx
  800be9:	89 c3                	mov    %eax,%ebx
  800beb:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800bee:	eb 06                	jmp    800bf6 <strncmp+0x1b>
		n--, p++, q++;
  800bf0:	83 c0 01             	add    $0x1,%eax
  800bf3:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800bf6:	39 d8                	cmp    %ebx,%eax
  800bf8:	74 16                	je     800c10 <strncmp+0x35>
  800bfa:	0f b6 08             	movzbl (%eax),%ecx
  800bfd:	84 c9                	test   %cl,%cl
  800bff:	74 04                	je     800c05 <strncmp+0x2a>
  800c01:	3a 0a                	cmp    (%edx),%cl
  800c03:	74 eb                	je     800bf0 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  800c05:	0f b6 00             	movzbl (%eax),%eax
  800c08:	0f b6 12             	movzbl (%edx),%edx
  800c0b:	29 d0                	sub    %edx,%eax
}
  800c0d:	5b                   	pop    %ebx
  800c0e:	5d                   	pop    %ebp
  800c0f:	c3                   	ret    
		return 0;
  800c10:	b8 00 00 00 00       	mov    $0x0,%eax
  800c15:	eb f6                	jmp    800c0d <strncmp+0x32>

00800c17 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800c17:	f3 0f 1e fb          	endbr32 
  800c1b:	55                   	push   %ebp
  800c1c:	89 e5                	mov    %esp,%ebp
  800c1e:	8b 45 08             	mov    0x8(%ebp),%eax
  800c21:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800c25:	0f b6 10             	movzbl (%eax),%edx
  800c28:	84 d2                	test   %dl,%dl
  800c2a:	74 09                	je     800c35 <strchr+0x1e>
		if (*s == c)
  800c2c:	38 ca                	cmp    %cl,%dl
  800c2e:	74 0a                	je     800c3a <strchr+0x23>
	for (; *s; s++)
  800c30:	83 c0 01             	add    $0x1,%eax
  800c33:	eb f0                	jmp    800c25 <strchr+0xe>
			return (char *) s;
	return 0;
  800c35:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800c3a:	5d                   	pop    %ebp
  800c3b:	c3                   	ret    

00800c3c <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  800c3c:	f3 0f 1e fb          	endbr32 
  800c40:	55                   	push   %ebp
  800c41:	89 e5                	mov    %esp,%ebp
  800c43:	8b 45 08             	mov    0x8(%ebp),%eax
  800c46:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800c4a:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  800c4d:	38 ca                	cmp    %cl,%dl
  800c4f:	74 09                	je     800c5a <strfind+0x1e>
  800c51:	84 d2                	test   %dl,%dl
  800c53:	74 05                	je     800c5a <strfind+0x1e>
	for (; *s; s++)
  800c55:	83 c0 01             	add    $0x1,%eax
  800c58:	eb f0                	jmp    800c4a <strfind+0xe>
			break;
	return (char *) s;
}
  800c5a:	5d                   	pop    %ebp
  800c5b:	c3                   	ret    

00800c5c <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  800c5c:	f3 0f 1e fb          	endbr32 
  800c60:	55                   	push   %ebp
  800c61:	89 e5                	mov    %esp,%ebp
  800c63:	57                   	push   %edi
  800c64:	56                   	push   %esi
  800c65:	53                   	push   %ebx
  800c66:	8b 7d 08             	mov    0x8(%ebp),%edi
  800c69:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  800c6c:	85 c9                	test   %ecx,%ecx
  800c6e:	74 31                	je     800ca1 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  800c70:	89 f8                	mov    %edi,%eax
  800c72:	09 c8                	or     %ecx,%eax
  800c74:	a8 03                	test   $0x3,%al
  800c76:	75 23                	jne    800c9b <memset+0x3f>
		c &= 0xFF;
  800c78:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  800c7c:	89 d3                	mov    %edx,%ebx
  800c7e:	c1 e3 08             	shl    $0x8,%ebx
  800c81:	89 d0                	mov    %edx,%eax
  800c83:	c1 e0 18             	shl    $0x18,%eax
  800c86:	89 d6                	mov    %edx,%esi
  800c88:	c1 e6 10             	shl    $0x10,%esi
  800c8b:	09 f0                	or     %esi,%eax
  800c8d:	09 c2                	or     %eax,%edx
  800c8f:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  800c91:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  800c94:	89 d0                	mov    %edx,%eax
  800c96:	fc                   	cld    
  800c97:	f3 ab                	rep stos %eax,%es:(%edi)
  800c99:	eb 06                	jmp    800ca1 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800c9b:	8b 45 0c             	mov    0xc(%ebp),%eax
  800c9e:	fc                   	cld    
  800c9f:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  800ca1:	89 f8                	mov    %edi,%eax
  800ca3:	5b                   	pop    %ebx
  800ca4:	5e                   	pop    %esi
  800ca5:	5f                   	pop    %edi
  800ca6:	5d                   	pop    %ebp
  800ca7:	c3                   	ret    

00800ca8 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800ca8:	f3 0f 1e fb          	endbr32 
  800cac:	55                   	push   %ebp
  800cad:	89 e5                	mov    %esp,%ebp
  800caf:	57                   	push   %edi
  800cb0:	56                   	push   %esi
  800cb1:	8b 45 08             	mov    0x8(%ebp),%eax
  800cb4:	8b 75 0c             	mov    0xc(%ebp),%esi
  800cb7:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800cba:	39 c6                	cmp    %eax,%esi
  800cbc:	73 32                	jae    800cf0 <memmove+0x48>
  800cbe:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800cc1:	39 c2                	cmp    %eax,%edx
  800cc3:	76 2b                	jbe    800cf0 <memmove+0x48>
		s += n;
		d += n;
  800cc5:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800cc8:	89 fe                	mov    %edi,%esi
  800cca:	09 ce                	or     %ecx,%esi
  800ccc:	09 d6                	or     %edx,%esi
  800cce:	f7 c6 03 00 00 00    	test   $0x3,%esi
  800cd4:	75 0e                	jne    800ce4 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800cd6:	83 ef 04             	sub    $0x4,%edi
  800cd9:	8d 72 fc             	lea    -0x4(%edx),%esi
  800cdc:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800cdf:	fd                   	std    
  800ce0:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800ce2:	eb 09                	jmp    800ced <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800ce4:	83 ef 01             	sub    $0x1,%edi
  800ce7:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800cea:	fd                   	std    
  800ceb:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800ced:	fc                   	cld    
  800cee:	eb 1a                	jmp    800d0a <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800cf0:	89 c2                	mov    %eax,%edx
  800cf2:	09 ca                	or     %ecx,%edx
  800cf4:	09 f2                	or     %esi,%edx
  800cf6:	f6 c2 03             	test   $0x3,%dl
  800cf9:	75 0a                	jne    800d05 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800cfb:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800cfe:	89 c7                	mov    %eax,%edi
  800d00:	fc                   	cld    
  800d01:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800d03:	eb 05                	jmp    800d0a <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800d05:	89 c7                	mov    %eax,%edi
  800d07:	fc                   	cld    
  800d08:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800d0a:	5e                   	pop    %esi
  800d0b:	5f                   	pop    %edi
  800d0c:	5d                   	pop    %ebp
  800d0d:	c3                   	ret    

00800d0e <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800d0e:	f3 0f 1e fb          	endbr32 
  800d12:	55                   	push   %ebp
  800d13:	89 e5                	mov    %esp,%ebp
  800d15:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800d18:	ff 75 10             	pushl  0x10(%ebp)
  800d1b:	ff 75 0c             	pushl  0xc(%ebp)
  800d1e:	ff 75 08             	pushl  0x8(%ebp)
  800d21:	e8 82 ff ff ff       	call   800ca8 <memmove>
}
  800d26:	c9                   	leave  
  800d27:	c3                   	ret    

00800d28 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800d28:	f3 0f 1e fb          	endbr32 
  800d2c:	55                   	push   %ebp
  800d2d:	89 e5                	mov    %esp,%ebp
  800d2f:	56                   	push   %esi
  800d30:	53                   	push   %ebx
  800d31:	8b 45 08             	mov    0x8(%ebp),%eax
  800d34:	8b 55 0c             	mov    0xc(%ebp),%edx
  800d37:	89 c6                	mov    %eax,%esi
  800d39:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800d3c:	39 f0                	cmp    %esi,%eax
  800d3e:	74 1c                	je     800d5c <memcmp+0x34>
		if (*s1 != *s2)
  800d40:	0f b6 08             	movzbl (%eax),%ecx
  800d43:	0f b6 1a             	movzbl (%edx),%ebx
  800d46:	38 d9                	cmp    %bl,%cl
  800d48:	75 08                	jne    800d52 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800d4a:	83 c0 01             	add    $0x1,%eax
  800d4d:	83 c2 01             	add    $0x1,%edx
  800d50:	eb ea                	jmp    800d3c <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800d52:	0f b6 c1             	movzbl %cl,%eax
  800d55:	0f b6 db             	movzbl %bl,%ebx
  800d58:	29 d8                	sub    %ebx,%eax
  800d5a:	eb 05                	jmp    800d61 <memcmp+0x39>
	}

	return 0;
  800d5c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800d61:	5b                   	pop    %ebx
  800d62:	5e                   	pop    %esi
  800d63:	5d                   	pop    %ebp
  800d64:	c3                   	ret    

00800d65 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800d65:	f3 0f 1e fb          	endbr32 
  800d69:	55                   	push   %ebp
  800d6a:	89 e5                	mov    %esp,%ebp
  800d6c:	8b 45 08             	mov    0x8(%ebp),%eax
  800d6f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800d72:	89 c2                	mov    %eax,%edx
  800d74:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800d77:	39 d0                	cmp    %edx,%eax
  800d79:	73 09                	jae    800d84 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800d7b:	38 08                	cmp    %cl,(%eax)
  800d7d:	74 05                	je     800d84 <memfind+0x1f>
	for (; s < ends; s++)
  800d7f:	83 c0 01             	add    $0x1,%eax
  800d82:	eb f3                	jmp    800d77 <memfind+0x12>
			break;
	return (void *) s;
}
  800d84:	5d                   	pop    %ebp
  800d85:	c3                   	ret    

00800d86 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800d86:	f3 0f 1e fb          	endbr32 
  800d8a:	55                   	push   %ebp
  800d8b:	89 e5                	mov    %esp,%ebp
  800d8d:	57                   	push   %edi
  800d8e:	56                   	push   %esi
  800d8f:	53                   	push   %ebx
  800d90:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800d93:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800d96:	eb 03                	jmp    800d9b <strtol+0x15>
		s++;
  800d98:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800d9b:	0f b6 01             	movzbl (%ecx),%eax
  800d9e:	3c 20                	cmp    $0x20,%al
  800da0:	74 f6                	je     800d98 <strtol+0x12>
  800da2:	3c 09                	cmp    $0x9,%al
  800da4:	74 f2                	je     800d98 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800da6:	3c 2b                	cmp    $0x2b,%al
  800da8:	74 2a                	je     800dd4 <strtol+0x4e>
	int neg = 0;
  800daa:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800daf:	3c 2d                	cmp    $0x2d,%al
  800db1:	74 2b                	je     800dde <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800db3:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800db9:	75 0f                	jne    800dca <strtol+0x44>
  800dbb:	80 39 30             	cmpb   $0x30,(%ecx)
  800dbe:	74 28                	je     800de8 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800dc0:	85 db                	test   %ebx,%ebx
  800dc2:	b8 0a 00 00 00       	mov    $0xa,%eax
  800dc7:	0f 44 d8             	cmove  %eax,%ebx
  800dca:	b8 00 00 00 00       	mov    $0x0,%eax
  800dcf:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800dd2:	eb 46                	jmp    800e1a <strtol+0x94>
		s++;
  800dd4:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800dd7:	bf 00 00 00 00       	mov    $0x0,%edi
  800ddc:	eb d5                	jmp    800db3 <strtol+0x2d>
		s++, neg = 1;
  800dde:	83 c1 01             	add    $0x1,%ecx
  800de1:	bf 01 00 00 00       	mov    $0x1,%edi
  800de6:	eb cb                	jmp    800db3 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800de8:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800dec:	74 0e                	je     800dfc <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800dee:	85 db                	test   %ebx,%ebx
  800df0:	75 d8                	jne    800dca <strtol+0x44>
		s++, base = 8;
  800df2:	83 c1 01             	add    $0x1,%ecx
  800df5:	bb 08 00 00 00       	mov    $0x8,%ebx
  800dfa:	eb ce                	jmp    800dca <strtol+0x44>
		s += 2, base = 16;
  800dfc:	83 c1 02             	add    $0x2,%ecx
  800dff:	bb 10 00 00 00       	mov    $0x10,%ebx
  800e04:	eb c4                	jmp    800dca <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800e06:	0f be d2             	movsbl %dl,%edx
  800e09:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800e0c:	3b 55 10             	cmp    0x10(%ebp),%edx
  800e0f:	7d 3a                	jge    800e4b <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800e11:	83 c1 01             	add    $0x1,%ecx
  800e14:	0f af 45 10          	imul   0x10(%ebp),%eax
  800e18:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800e1a:	0f b6 11             	movzbl (%ecx),%edx
  800e1d:	8d 72 d0             	lea    -0x30(%edx),%esi
  800e20:	89 f3                	mov    %esi,%ebx
  800e22:	80 fb 09             	cmp    $0x9,%bl
  800e25:	76 df                	jbe    800e06 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800e27:	8d 72 9f             	lea    -0x61(%edx),%esi
  800e2a:	89 f3                	mov    %esi,%ebx
  800e2c:	80 fb 19             	cmp    $0x19,%bl
  800e2f:	77 08                	ja     800e39 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800e31:	0f be d2             	movsbl %dl,%edx
  800e34:	83 ea 57             	sub    $0x57,%edx
  800e37:	eb d3                	jmp    800e0c <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800e39:	8d 72 bf             	lea    -0x41(%edx),%esi
  800e3c:	89 f3                	mov    %esi,%ebx
  800e3e:	80 fb 19             	cmp    $0x19,%bl
  800e41:	77 08                	ja     800e4b <strtol+0xc5>
			dig = *s - 'A' + 10;
  800e43:	0f be d2             	movsbl %dl,%edx
  800e46:	83 ea 37             	sub    $0x37,%edx
  800e49:	eb c1                	jmp    800e0c <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800e4b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800e4f:	74 05                	je     800e56 <strtol+0xd0>
		*endptr = (char *) s;
  800e51:	8b 75 0c             	mov    0xc(%ebp),%esi
  800e54:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800e56:	89 c2                	mov    %eax,%edx
  800e58:	f7 da                	neg    %edx
  800e5a:	85 ff                	test   %edi,%edi
  800e5c:	0f 45 c2             	cmovne %edx,%eax
}
  800e5f:	5b                   	pop    %ebx
  800e60:	5e                   	pop    %esi
  800e61:	5f                   	pop    %edi
  800e62:	5d                   	pop    %ebp
  800e63:	c3                   	ret    

00800e64 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800e64:	f3 0f 1e fb          	endbr32 
  800e68:	55                   	push   %ebp
  800e69:	89 e5                	mov    %esp,%ebp
  800e6b:	57                   	push   %edi
  800e6c:	56                   	push   %esi
  800e6d:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e6e:	b8 00 00 00 00       	mov    $0x0,%eax
  800e73:	8b 55 08             	mov    0x8(%ebp),%edx
  800e76:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e79:	89 c3                	mov    %eax,%ebx
  800e7b:	89 c7                	mov    %eax,%edi
  800e7d:	89 c6                	mov    %eax,%esi
  800e7f:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800e81:	5b                   	pop    %ebx
  800e82:	5e                   	pop    %esi
  800e83:	5f                   	pop    %edi
  800e84:	5d                   	pop    %ebp
  800e85:	c3                   	ret    

00800e86 <sys_cgetc>:

int
sys_cgetc(void)
{
  800e86:	f3 0f 1e fb          	endbr32 
  800e8a:	55                   	push   %ebp
  800e8b:	89 e5                	mov    %esp,%ebp
  800e8d:	57                   	push   %edi
  800e8e:	56                   	push   %esi
  800e8f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e90:	ba 00 00 00 00       	mov    $0x0,%edx
  800e95:	b8 01 00 00 00       	mov    $0x1,%eax
  800e9a:	89 d1                	mov    %edx,%ecx
  800e9c:	89 d3                	mov    %edx,%ebx
  800e9e:	89 d7                	mov    %edx,%edi
  800ea0:	89 d6                	mov    %edx,%esi
  800ea2:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800ea4:	5b                   	pop    %ebx
  800ea5:	5e                   	pop    %esi
  800ea6:	5f                   	pop    %edi
  800ea7:	5d                   	pop    %ebp
  800ea8:	c3                   	ret    

00800ea9 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800ea9:	f3 0f 1e fb          	endbr32 
  800ead:	55                   	push   %ebp
  800eae:	89 e5                	mov    %esp,%ebp
  800eb0:	57                   	push   %edi
  800eb1:	56                   	push   %esi
  800eb2:	53                   	push   %ebx
  800eb3:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800eb6:	b9 00 00 00 00       	mov    $0x0,%ecx
  800ebb:	8b 55 08             	mov    0x8(%ebp),%edx
  800ebe:	b8 03 00 00 00       	mov    $0x3,%eax
  800ec3:	89 cb                	mov    %ecx,%ebx
  800ec5:	89 cf                	mov    %ecx,%edi
  800ec7:	89 ce                	mov    %ecx,%esi
  800ec9:	cd 30                	int    $0x30
	if(check && ret > 0)
  800ecb:	85 c0                	test   %eax,%eax
  800ecd:	7f 08                	jg     800ed7 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800ecf:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ed2:	5b                   	pop    %ebx
  800ed3:	5e                   	pop    %esi
  800ed4:	5f                   	pop    %edi
  800ed5:	5d                   	pop    %ebp
  800ed6:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ed7:	83 ec 0c             	sub    $0xc,%esp
  800eda:	50                   	push   %eax
  800edb:	6a 03                	push   $0x3
  800edd:	68 9f 2b 80 00       	push   $0x802b9f
  800ee2:	6a 23                	push   $0x23
  800ee4:	68 bc 2b 80 00       	push   $0x802bbc
  800ee9:	e8 44 f5 ff ff       	call   800432 <_panic>

00800eee <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800eee:	f3 0f 1e fb          	endbr32 
  800ef2:	55                   	push   %ebp
  800ef3:	89 e5                	mov    %esp,%ebp
  800ef5:	57                   	push   %edi
  800ef6:	56                   	push   %esi
  800ef7:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ef8:	ba 00 00 00 00       	mov    $0x0,%edx
  800efd:	b8 02 00 00 00       	mov    $0x2,%eax
  800f02:	89 d1                	mov    %edx,%ecx
  800f04:	89 d3                	mov    %edx,%ebx
  800f06:	89 d7                	mov    %edx,%edi
  800f08:	89 d6                	mov    %edx,%esi
  800f0a:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800f0c:	5b                   	pop    %ebx
  800f0d:	5e                   	pop    %esi
  800f0e:	5f                   	pop    %edi
  800f0f:	5d                   	pop    %ebp
  800f10:	c3                   	ret    

00800f11 <sys_yield>:

void
sys_yield(void)
{
  800f11:	f3 0f 1e fb          	endbr32 
  800f15:	55                   	push   %ebp
  800f16:	89 e5                	mov    %esp,%ebp
  800f18:	57                   	push   %edi
  800f19:	56                   	push   %esi
  800f1a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800f1b:	ba 00 00 00 00       	mov    $0x0,%edx
  800f20:	b8 0b 00 00 00       	mov    $0xb,%eax
  800f25:	89 d1                	mov    %edx,%ecx
  800f27:	89 d3                	mov    %edx,%ebx
  800f29:	89 d7                	mov    %edx,%edi
  800f2b:	89 d6                	mov    %edx,%esi
  800f2d:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800f2f:	5b                   	pop    %ebx
  800f30:	5e                   	pop    %esi
  800f31:	5f                   	pop    %edi
  800f32:	5d                   	pop    %ebp
  800f33:	c3                   	ret    

00800f34 <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800f34:	f3 0f 1e fb          	endbr32 
  800f38:	55                   	push   %ebp
  800f39:	89 e5                	mov    %esp,%ebp
  800f3b:	57                   	push   %edi
  800f3c:	56                   	push   %esi
  800f3d:	53                   	push   %ebx
  800f3e:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800f41:	be 00 00 00 00       	mov    $0x0,%esi
  800f46:	8b 55 08             	mov    0x8(%ebp),%edx
  800f49:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f4c:	b8 04 00 00 00       	mov    $0x4,%eax
  800f51:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800f54:	89 f7                	mov    %esi,%edi
  800f56:	cd 30                	int    $0x30
	if(check && ret > 0)
  800f58:	85 c0                	test   %eax,%eax
  800f5a:	7f 08                	jg     800f64 <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800f5c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f5f:	5b                   	pop    %ebx
  800f60:	5e                   	pop    %esi
  800f61:	5f                   	pop    %edi
  800f62:	5d                   	pop    %ebp
  800f63:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800f64:	83 ec 0c             	sub    $0xc,%esp
  800f67:	50                   	push   %eax
  800f68:	6a 04                	push   $0x4
  800f6a:	68 9f 2b 80 00       	push   $0x802b9f
  800f6f:	6a 23                	push   $0x23
  800f71:	68 bc 2b 80 00       	push   $0x802bbc
  800f76:	e8 b7 f4 ff ff       	call   800432 <_panic>

00800f7b <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800f7b:	f3 0f 1e fb          	endbr32 
  800f7f:	55                   	push   %ebp
  800f80:	89 e5                	mov    %esp,%ebp
  800f82:	57                   	push   %edi
  800f83:	56                   	push   %esi
  800f84:	53                   	push   %ebx
  800f85:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800f88:	8b 55 08             	mov    0x8(%ebp),%edx
  800f8b:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f8e:	b8 05 00 00 00       	mov    $0x5,%eax
  800f93:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800f96:	8b 7d 14             	mov    0x14(%ebp),%edi
  800f99:	8b 75 18             	mov    0x18(%ebp),%esi
  800f9c:	cd 30                	int    $0x30
	if(check && ret > 0)
  800f9e:	85 c0                	test   %eax,%eax
  800fa0:	7f 08                	jg     800faa <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800fa2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800fa5:	5b                   	pop    %ebx
  800fa6:	5e                   	pop    %esi
  800fa7:	5f                   	pop    %edi
  800fa8:	5d                   	pop    %ebp
  800fa9:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800faa:	83 ec 0c             	sub    $0xc,%esp
  800fad:	50                   	push   %eax
  800fae:	6a 05                	push   $0x5
  800fb0:	68 9f 2b 80 00       	push   $0x802b9f
  800fb5:	6a 23                	push   $0x23
  800fb7:	68 bc 2b 80 00       	push   $0x802bbc
  800fbc:	e8 71 f4 ff ff       	call   800432 <_panic>

00800fc1 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800fc1:	f3 0f 1e fb          	endbr32 
  800fc5:	55                   	push   %ebp
  800fc6:	89 e5                	mov    %esp,%ebp
  800fc8:	57                   	push   %edi
  800fc9:	56                   	push   %esi
  800fca:	53                   	push   %ebx
  800fcb:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800fce:	bb 00 00 00 00       	mov    $0x0,%ebx
  800fd3:	8b 55 08             	mov    0x8(%ebp),%edx
  800fd6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800fd9:	b8 06 00 00 00       	mov    $0x6,%eax
  800fde:	89 df                	mov    %ebx,%edi
  800fe0:	89 de                	mov    %ebx,%esi
  800fe2:	cd 30                	int    $0x30
	if(check && ret > 0)
  800fe4:	85 c0                	test   %eax,%eax
  800fe6:	7f 08                	jg     800ff0 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800fe8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800feb:	5b                   	pop    %ebx
  800fec:	5e                   	pop    %esi
  800fed:	5f                   	pop    %edi
  800fee:	5d                   	pop    %ebp
  800fef:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ff0:	83 ec 0c             	sub    $0xc,%esp
  800ff3:	50                   	push   %eax
  800ff4:	6a 06                	push   $0x6
  800ff6:	68 9f 2b 80 00       	push   $0x802b9f
  800ffb:	6a 23                	push   $0x23
  800ffd:	68 bc 2b 80 00       	push   $0x802bbc
  801002:	e8 2b f4 ff ff       	call   800432 <_panic>

00801007 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  801007:	f3 0f 1e fb          	endbr32 
  80100b:	55                   	push   %ebp
  80100c:	89 e5                	mov    %esp,%ebp
  80100e:	57                   	push   %edi
  80100f:	56                   	push   %esi
  801010:	53                   	push   %ebx
  801011:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  801014:	bb 00 00 00 00       	mov    $0x0,%ebx
  801019:	8b 55 08             	mov    0x8(%ebp),%edx
  80101c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80101f:	b8 08 00 00 00       	mov    $0x8,%eax
  801024:	89 df                	mov    %ebx,%edi
  801026:	89 de                	mov    %ebx,%esi
  801028:	cd 30                	int    $0x30
	if(check && ret > 0)
  80102a:	85 c0                	test   %eax,%eax
  80102c:	7f 08                	jg     801036 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  80102e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801031:	5b                   	pop    %ebx
  801032:	5e                   	pop    %esi
  801033:	5f                   	pop    %edi
  801034:	5d                   	pop    %ebp
  801035:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  801036:	83 ec 0c             	sub    $0xc,%esp
  801039:	50                   	push   %eax
  80103a:	6a 08                	push   $0x8
  80103c:	68 9f 2b 80 00       	push   $0x802b9f
  801041:	6a 23                	push   $0x23
  801043:	68 bc 2b 80 00       	push   $0x802bbc
  801048:	e8 e5 f3 ff ff       	call   800432 <_panic>

0080104d <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  80104d:	f3 0f 1e fb          	endbr32 
  801051:	55                   	push   %ebp
  801052:	89 e5                	mov    %esp,%ebp
  801054:	57                   	push   %edi
  801055:	56                   	push   %esi
  801056:	53                   	push   %ebx
  801057:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  80105a:	bb 00 00 00 00       	mov    $0x0,%ebx
  80105f:	8b 55 08             	mov    0x8(%ebp),%edx
  801062:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801065:	b8 09 00 00 00       	mov    $0x9,%eax
  80106a:	89 df                	mov    %ebx,%edi
  80106c:	89 de                	mov    %ebx,%esi
  80106e:	cd 30                	int    $0x30
	if(check && ret > 0)
  801070:	85 c0                	test   %eax,%eax
  801072:	7f 08                	jg     80107c <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  801074:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801077:	5b                   	pop    %ebx
  801078:	5e                   	pop    %esi
  801079:	5f                   	pop    %edi
  80107a:	5d                   	pop    %ebp
  80107b:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80107c:	83 ec 0c             	sub    $0xc,%esp
  80107f:	50                   	push   %eax
  801080:	6a 09                	push   $0x9
  801082:	68 9f 2b 80 00       	push   $0x802b9f
  801087:	6a 23                	push   $0x23
  801089:	68 bc 2b 80 00       	push   $0x802bbc
  80108e:	e8 9f f3 ff ff       	call   800432 <_panic>

00801093 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  801093:	f3 0f 1e fb          	endbr32 
  801097:	55                   	push   %ebp
  801098:	89 e5                	mov    %esp,%ebp
  80109a:	57                   	push   %edi
  80109b:	56                   	push   %esi
  80109c:	53                   	push   %ebx
  80109d:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8010a0:	bb 00 00 00 00       	mov    $0x0,%ebx
  8010a5:	8b 55 08             	mov    0x8(%ebp),%edx
  8010a8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8010ab:	b8 0a 00 00 00       	mov    $0xa,%eax
  8010b0:	89 df                	mov    %ebx,%edi
  8010b2:	89 de                	mov    %ebx,%esi
  8010b4:	cd 30                	int    $0x30
	if(check && ret > 0)
  8010b6:	85 c0                	test   %eax,%eax
  8010b8:	7f 08                	jg     8010c2 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  8010ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8010bd:	5b                   	pop    %ebx
  8010be:	5e                   	pop    %esi
  8010bf:	5f                   	pop    %edi
  8010c0:	5d                   	pop    %ebp
  8010c1:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  8010c2:	83 ec 0c             	sub    $0xc,%esp
  8010c5:	50                   	push   %eax
  8010c6:	6a 0a                	push   $0xa
  8010c8:	68 9f 2b 80 00       	push   $0x802b9f
  8010cd:	6a 23                	push   $0x23
  8010cf:	68 bc 2b 80 00       	push   $0x802bbc
  8010d4:	e8 59 f3 ff ff       	call   800432 <_panic>

008010d9 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  8010d9:	f3 0f 1e fb          	endbr32 
  8010dd:	55                   	push   %ebp
  8010de:	89 e5                	mov    %esp,%ebp
  8010e0:	57                   	push   %edi
  8010e1:	56                   	push   %esi
  8010e2:	53                   	push   %ebx
	asm volatile("int %1\n"
  8010e3:	8b 55 08             	mov    0x8(%ebp),%edx
  8010e6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8010e9:	b8 0c 00 00 00       	mov    $0xc,%eax
  8010ee:	be 00 00 00 00       	mov    $0x0,%esi
  8010f3:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8010f6:	8b 7d 14             	mov    0x14(%ebp),%edi
  8010f9:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  8010fb:	5b                   	pop    %ebx
  8010fc:	5e                   	pop    %esi
  8010fd:	5f                   	pop    %edi
  8010fe:	5d                   	pop    %ebp
  8010ff:	c3                   	ret    

00801100 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  801100:	f3 0f 1e fb          	endbr32 
  801104:	55                   	push   %ebp
  801105:	89 e5                	mov    %esp,%ebp
  801107:	57                   	push   %edi
  801108:	56                   	push   %esi
  801109:	53                   	push   %ebx
  80110a:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  80110d:	b9 00 00 00 00       	mov    $0x0,%ecx
  801112:	8b 55 08             	mov    0x8(%ebp),%edx
  801115:	b8 0d 00 00 00       	mov    $0xd,%eax
  80111a:	89 cb                	mov    %ecx,%ebx
  80111c:	89 cf                	mov    %ecx,%edi
  80111e:	89 ce                	mov    %ecx,%esi
  801120:	cd 30                	int    $0x30
	if(check && ret > 0)
  801122:	85 c0                	test   %eax,%eax
  801124:	7f 08                	jg     80112e <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  801126:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801129:	5b                   	pop    %ebx
  80112a:	5e                   	pop    %esi
  80112b:	5f                   	pop    %edi
  80112c:	5d                   	pop    %ebp
  80112d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80112e:	83 ec 0c             	sub    $0xc,%esp
  801131:	50                   	push   %eax
  801132:	6a 0d                	push   $0xd
  801134:	68 9f 2b 80 00       	push   $0x802b9f
  801139:	6a 23                	push   $0x23
  80113b:	68 bc 2b 80 00       	push   $0x802bbc
  801140:	e8 ed f2 ff ff       	call   800432 <_panic>

00801145 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  801145:	f3 0f 1e fb          	endbr32 
  801149:	55                   	push   %ebp
  80114a:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  80114c:	8b 45 08             	mov    0x8(%ebp),%eax
  80114f:	05 00 00 00 30       	add    $0x30000000,%eax
  801154:	c1 e8 0c             	shr    $0xc,%eax
}
  801157:	5d                   	pop    %ebp
  801158:	c3                   	ret    

00801159 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  801159:	f3 0f 1e fb          	endbr32 
  80115d:	55                   	push   %ebp
  80115e:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801160:	8b 45 08             	mov    0x8(%ebp),%eax
  801163:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  801168:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  80116d:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  801172:	5d                   	pop    %ebp
  801173:	c3                   	ret    

00801174 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  801174:	f3 0f 1e fb          	endbr32 
  801178:	55                   	push   %ebp
  801179:	89 e5                	mov    %esp,%ebp
  80117b:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  801180:	89 c2                	mov    %eax,%edx
  801182:	c1 ea 16             	shr    $0x16,%edx
  801185:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  80118c:	f6 c2 01             	test   $0x1,%dl
  80118f:	74 2d                	je     8011be <fd_alloc+0x4a>
  801191:	89 c2                	mov    %eax,%edx
  801193:	c1 ea 0c             	shr    $0xc,%edx
  801196:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  80119d:	f6 c2 01             	test   $0x1,%dl
  8011a0:	74 1c                	je     8011be <fd_alloc+0x4a>
  8011a2:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  8011a7:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  8011ac:	75 d2                	jne    801180 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  8011ae:	8b 45 08             	mov    0x8(%ebp),%eax
  8011b1:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  8011b7:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  8011bc:	eb 0a                	jmp    8011c8 <fd_alloc+0x54>
			*fd_store = fd;
  8011be:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8011c1:	89 01                	mov    %eax,(%ecx)
			return 0;
  8011c3:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8011c8:	5d                   	pop    %ebp
  8011c9:	c3                   	ret    

008011ca <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  8011ca:	f3 0f 1e fb          	endbr32 
  8011ce:	55                   	push   %ebp
  8011cf:	89 e5                	mov    %esp,%ebp
  8011d1:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  8011d4:	83 f8 1f             	cmp    $0x1f,%eax
  8011d7:	77 30                	ja     801209 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  8011d9:	c1 e0 0c             	shl    $0xc,%eax
  8011dc:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  8011e1:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  8011e7:	f6 c2 01             	test   $0x1,%dl
  8011ea:	74 24                	je     801210 <fd_lookup+0x46>
  8011ec:	89 c2                	mov    %eax,%edx
  8011ee:	c1 ea 0c             	shr    $0xc,%edx
  8011f1:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  8011f8:	f6 c2 01             	test   $0x1,%dl
  8011fb:	74 1a                	je     801217 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  8011fd:	8b 55 0c             	mov    0xc(%ebp),%edx
  801200:	89 02                	mov    %eax,(%edx)
	return 0;
  801202:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801207:	5d                   	pop    %ebp
  801208:	c3                   	ret    
		return -E_INVAL;
  801209:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80120e:	eb f7                	jmp    801207 <fd_lookup+0x3d>
		return -E_INVAL;
  801210:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801215:	eb f0                	jmp    801207 <fd_lookup+0x3d>
  801217:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80121c:	eb e9                	jmp    801207 <fd_lookup+0x3d>

0080121e <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  80121e:	f3 0f 1e fb          	endbr32 
  801222:	55                   	push   %ebp
  801223:	89 e5                	mov    %esp,%ebp
  801225:	83 ec 08             	sub    $0x8,%esp
  801228:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80122b:	ba 48 2c 80 00       	mov    $0x802c48,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  801230:	b8 90 47 80 00       	mov    $0x804790,%eax
		if (devtab[i]->dev_id == dev_id) {
  801235:	39 08                	cmp    %ecx,(%eax)
  801237:	74 33                	je     80126c <dev_lookup+0x4e>
  801239:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  80123c:	8b 02                	mov    (%edx),%eax
  80123e:	85 c0                	test   %eax,%eax
  801240:	75 f3                	jne    801235 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  801242:	a1 90 67 80 00       	mov    0x806790,%eax
  801247:	8b 40 48             	mov    0x48(%eax),%eax
  80124a:	83 ec 04             	sub    $0x4,%esp
  80124d:	51                   	push   %ecx
  80124e:	50                   	push   %eax
  80124f:	68 cc 2b 80 00       	push   $0x802bcc
  801254:	e8 c0 f2 ff ff       	call   800519 <cprintf>
	*dev = 0;
  801259:	8b 45 0c             	mov    0xc(%ebp),%eax
  80125c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  801262:	83 c4 10             	add    $0x10,%esp
  801265:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  80126a:	c9                   	leave  
  80126b:	c3                   	ret    
			*dev = devtab[i];
  80126c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80126f:	89 01                	mov    %eax,(%ecx)
			return 0;
  801271:	b8 00 00 00 00       	mov    $0x0,%eax
  801276:	eb f2                	jmp    80126a <dev_lookup+0x4c>

00801278 <fd_close>:
{
  801278:	f3 0f 1e fb          	endbr32 
  80127c:	55                   	push   %ebp
  80127d:	89 e5                	mov    %esp,%ebp
  80127f:	57                   	push   %edi
  801280:	56                   	push   %esi
  801281:	53                   	push   %ebx
  801282:	83 ec 24             	sub    $0x24,%esp
  801285:	8b 75 08             	mov    0x8(%ebp),%esi
  801288:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  80128b:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80128e:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  80128f:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  801295:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801298:	50                   	push   %eax
  801299:	e8 2c ff ff ff       	call   8011ca <fd_lookup>
  80129e:	89 c3                	mov    %eax,%ebx
  8012a0:	83 c4 10             	add    $0x10,%esp
  8012a3:	85 c0                	test   %eax,%eax
  8012a5:	78 05                	js     8012ac <fd_close+0x34>
	    || fd != fd2)
  8012a7:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  8012aa:	74 16                	je     8012c2 <fd_close+0x4a>
		return (must_exist ? r : 0);
  8012ac:	89 f8                	mov    %edi,%eax
  8012ae:	84 c0                	test   %al,%al
  8012b0:	b8 00 00 00 00       	mov    $0x0,%eax
  8012b5:	0f 44 d8             	cmove  %eax,%ebx
}
  8012b8:	89 d8                	mov    %ebx,%eax
  8012ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8012bd:	5b                   	pop    %ebx
  8012be:	5e                   	pop    %esi
  8012bf:	5f                   	pop    %edi
  8012c0:	5d                   	pop    %ebp
  8012c1:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  8012c2:	83 ec 08             	sub    $0x8,%esp
  8012c5:	8d 45 e0             	lea    -0x20(%ebp),%eax
  8012c8:	50                   	push   %eax
  8012c9:	ff 36                	pushl  (%esi)
  8012cb:	e8 4e ff ff ff       	call   80121e <dev_lookup>
  8012d0:	89 c3                	mov    %eax,%ebx
  8012d2:	83 c4 10             	add    $0x10,%esp
  8012d5:	85 c0                	test   %eax,%eax
  8012d7:	78 1a                	js     8012f3 <fd_close+0x7b>
		if (dev->dev_close)
  8012d9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8012dc:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  8012df:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  8012e4:	85 c0                	test   %eax,%eax
  8012e6:	74 0b                	je     8012f3 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  8012e8:	83 ec 0c             	sub    $0xc,%esp
  8012eb:	56                   	push   %esi
  8012ec:	ff d0                	call   *%eax
  8012ee:	89 c3                	mov    %eax,%ebx
  8012f0:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  8012f3:	83 ec 08             	sub    $0x8,%esp
  8012f6:	56                   	push   %esi
  8012f7:	6a 00                	push   $0x0
  8012f9:	e8 c3 fc ff ff       	call   800fc1 <sys_page_unmap>
	return r;
  8012fe:	83 c4 10             	add    $0x10,%esp
  801301:	eb b5                	jmp    8012b8 <fd_close+0x40>

00801303 <close>:

int
close(int fdnum)
{
  801303:	f3 0f 1e fb          	endbr32 
  801307:	55                   	push   %ebp
  801308:	89 e5                	mov    %esp,%ebp
  80130a:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80130d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801310:	50                   	push   %eax
  801311:	ff 75 08             	pushl  0x8(%ebp)
  801314:	e8 b1 fe ff ff       	call   8011ca <fd_lookup>
  801319:	83 c4 10             	add    $0x10,%esp
  80131c:	85 c0                	test   %eax,%eax
  80131e:	79 02                	jns    801322 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  801320:	c9                   	leave  
  801321:	c3                   	ret    
		return fd_close(fd, 1);
  801322:	83 ec 08             	sub    $0x8,%esp
  801325:	6a 01                	push   $0x1
  801327:	ff 75 f4             	pushl  -0xc(%ebp)
  80132a:	e8 49 ff ff ff       	call   801278 <fd_close>
  80132f:	83 c4 10             	add    $0x10,%esp
  801332:	eb ec                	jmp    801320 <close+0x1d>

00801334 <close_all>:

void
close_all(void)
{
  801334:	f3 0f 1e fb          	endbr32 
  801338:	55                   	push   %ebp
  801339:	89 e5                	mov    %esp,%ebp
  80133b:	53                   	push   %ebx
  80133c:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  80133f:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  801344:	83 ec 0c             	sub    $0xc,%esp
  801347:	53                   	push   %ebx
  801348:	e8 b6 ff ff ff       	call   801303 <close>
	for (i = 0; i < MAXFD; i++)
  80134d:	83 c3 01             	add    $0x1,%ebx
  801350:	83 c4 10             	add    $0x10,%esp
  801353:	83 fb 20             	cmp    $0x20,%ebx
  801356:	75 ec                	jne    801344 <close_all+0x10>
}
  801358:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80135b:	c9                   	leave  
  80135c:	c3                   	ret    

0080135d <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  80135d:	f3 0f 1e fb          	endbr32 
  801361:	55                   	push   %ebp
  801362:	89 e5                	mov    %esp,%ebp
  801364:	57                   	push   %edi
  801365:	56                   	push   %esi
  801366:	53                   	push   %ebx
  801367:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  80136a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80136d:	50                   	push   %eax
  80136e:	ff 75 08             	pushl  0x8(%ebp)
  801371:	e8 54 fe ff ff       	call   8011ca <fd_lookup>
  801376:	89 c3                	mov    %eax,%ebx
  801378:	83 c4 10             	add    $0x10,%esp
  80137b:	85 c0                	test   %eax,%eax
  80137d:	0f 88 81 00 00 00    	js     801404 <dup+0xa7>
		return r;
	close(newfdnum);
  801383:	83 ec 0c             	sub    $0xc,%esp
  801386:	ff 75 0c             	pushl  0xc(%ebp)
  801389:	e8 75 ff ff ff       	call   801303 <close>

	newfd = INDEX2FD(newfdnum);
  80138e:	8b 75 0c             	mov    0xc(%ebp),%esi
  801391:	c1 e6 0c             	shl    $0xc,%esi
  801394:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  80139a:	83 c4 04             	add    $0x4,%esp
  80139d:	ff 75 e4             	pushl  -0x1c(%ebp)
  8013a0:	e8 b4 fd ff ff       	call   801159 <fd2data>
  8013a5:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  8013a7:	89 34 24             	mov    %esi,(%esp)
  8013aa:	e8 aa fd ff ff       	call   801159 <fd2data>
  8013af:	83 c4 10             	add    $0x10,%esp
  8013b2:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  8013b4:	89 d8                	mov    %ebx,%eax
  8013b6:	c1 e8 16             	shr    $0x16,%eax
  8013b9:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  8013c0:	a8 01                	test   $0x1,%al
  8013c2:	74 11                	je     8013d5 <dup+0x78>
  8013c4:	89 d8                	mov    %ebx,%eax
  8013c6:	c1 e8 0c             	shr    $0xc,%eax
  8013c9:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  8013d0:	f6 c2 01             	test   $0x1,%dl
  8013d3:	75 39                	jne    80140e <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  8013d5:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  8013d8:	89 d0                	mov    %edx,%eax
  8013da:	c1 e8 0c             	shr    $0xc,%eax
  8013dd:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  8013e4:	83 ec 0c             	sub    $0xc,%esp
  8013e7:	25 07 0e 00 00       	and    $0xe07,%eax
  8013ec:	50                   	push   %eax
  8013ed:	56                   	push   %esi
  8013ee:	6a 00                	push   $0x0
  8013f0:	52                   	push   %edx
  8013f1:	6a 00                	push   $0x0
  8013f3:	e8 83 fb ff ff       	call   800f7b <sys_page_map>
  8013f8:	89 c3                	mov    %eax,%ebx
  8013fa:	83 c4 20             	add    $0x20,%esp
  8013fd:	85 c0                	test   %eax,%eax
  8013ff:	78 31                	js     801432 <dup+0xd5>
		goto err;

	return newfdnum;
  801401:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  801404:	89 d8                	mov    %ebx,%eax
  801406:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801409:	5b                   	pop    %ebx
  80140a:	5e                   	pop    %esi
  80140b:	5f                   	pop    %edi
  80140c:	5d                   	pop    %ebp
  80140d:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  80140e:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801415:	83 ec 0c             	sub    $0xc,%esp
  801418:	25 07 0e 00 00       	and    $0xe07,%eax
  80141d:	50                   	push   %eax
  80141e:	57                   	push   %edi
  80141f:	6a 00                	push   $0x0
  801421:	53                   	push   %ebx
  801422:	6a 00                	push   $0x0
  801424:	e8 52 fb ff ff       	call   800f7b <sys_page_map>
  801429:	89 c3                	mov    %eax,%ebx
  80142b:	83 c4 20             	add    $0x20,%esp
  80142e:	85 c0                	test   %eax,%eax
  801430:	79 a3                	jns    8013d5 <dup+0x78>
	sys_page_unmap(0, newfd);
  801432:	83 ec 08             	sub    $0x8,%esp
  801435:	56                   	push   %esi
  801436:	6a 00                	push   $0x0
  801438:	e8 84 fb ff ff       	call   800fc1 <sys_page_unmap>
	sys_page_unmap(0, nva);
  80143d:	83 c4 08             	add    $0x8,%esp
  801440:	57                   	push   %edi
  801441:	6a 00                	push   $0x0
  801443:	e8 79 fb ff ff       	call   800fc1 <sys_page_unmap>
	return r;
  801448:	83 c4 10             	add    $0x10,%esp
  80144b:	eb b7                	jmp    801404 <dup+0xa7>

0080144d <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  80144d:	f3 0f 1e fb          	endbr32 
  801451:	55                   	push   %ebp
  801452:	89 e5                	mov    %esp,%ebp
  801454:	53                   	push   %ebx
  801455:	83 ec 1c             	sub    $0x1c,%esp
  801458:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80145b:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80145e:	50                   	push   %eax
  80145f:	53                   	push   %ebx
  801460:	e8 65 fd ff ff       	call   8011ca <fd_lookup>
  801465:	83 c4 10             	add    $0x10,%esp
  801468:	85 c0                	test   %eax,%eax
  80146a:	78 3f                	js     8014ab <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80146c:	83 ec 08             	sub    $0x8,%esp
  80146f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801472:	50                   	push   %eax
  801473:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801476:	ff 30                	pushl  (%eax)
  801478:	e8 a1 fd ff ff       	call   80121e <dev_lookup>
  80147d:	83 c4 10             	add    $0x10,%esp
  801480:	85 c0                	test   %eax,%eax
  801482:	78 27                	js     8014ab <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  801484:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801487:	8b 42 08             	mov    0x8(%edx),%eax
  80148a:	83 e0 03             	and    $0x3,%eax
  80148d:	83 f8 01             	cmp    $0x1,%eax
  801490:	74 1e                	je     8014b0 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  801492:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801495:	8b 40 08             	mov    0x8(%eax),%eax
  801498:	85 c0                	test   %eax,%eax
  80149a:	74 35                	je     8014d1 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  80149c:	83 ec 04             	sub    $0x4,%esp
  80149f:	ff 75 10             	pushl  0x10(%ebp)
  8014a2:	ff 75 0c             	pushl  0xc(%ebp)
  8014a5:	52                   	push   %edx
  8014a6:	ff d0                	call   *%eax
  8014a8:	83 c4 10             	add    $0x10,%esp
}
  8014ab:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8014ae:	c9                   	leave  
  8014af:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  8014b0:	a1 90 67 80 00       	mov    0x806790,%eax
  8014b5:	8b 40 48             	mov    0x48(%eax),%eax
  8014b8:	83 ec 04             	sub    $0x4,%esp
  8014bb:	53                   	push   %ebx
  8014bc:	50                   	push   %eax
  8014bd:	68 0d 2c 80 00       	push   $0x802c0d
  8014c2:	e8 52 f0 ff ff       	call   800519 <cprintf>
		return -E_INVAL;
  8014c7:	83 c4 10             	add    $0x10,%esp
  8014ca:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8014cf:	eb da                	jmp    8014ab <read+0x5e>
		return -E_NOT_SUPP;
  8014d1:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8014d6:	eb d3                	jmp    8014ab <read+0x5e>

008014d8 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  8014d8:	f3 0f 1e fb          	endbr32 
  8014dc:	55                   	push   %ebp
  8014dd:	89 e5                	mov    %esp,%ebp
  8014df:	57                   	push   %edi
  8014e0:	56                   	push   %esi
  8014e1:	53                   	push   %ebx
  8014e2:	83 ec 0c             	sub    $0xc,%esp
  8014e5:	8b 7d 08             	mov    0x8(%ebp),%edi
  8014e8:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  8014eb:	bb 00 00 00 00       	mov    $0x0,%ebx
  8014f0:	eb 02                	jmp    8014f4 <readn+0x1c>
  8014f2:	01 c3                	add    %eax,%ebx
  8014f4:	39 f3                	cmp    %esi,%ebx
  8014f6:	73 21                	jae    801519 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8014f8:	83 ec 04             	sub    $0x4,%esp
  8014fb:	89 f0                	mov    %esi,%eax
  8014fd:	29 d8                	sub    %ebx,%eax
  8014ff:	50                   	push   %eax
  801500:	89 d8                	mov    %ebx,%eax
  801502:	03 45 0c             	add    0xc(%ebp),%eax
  801505:	50                   	push   %eax
  801506:	57                   	push   %edi
  801507:	e8 41 ff ff ff       	call   80144d <read>
		if (m < 0)
  80150c:	83 c4 10             	add    $0x10,%esp
  80150f:	85 c0                	test   %eax,%eax
  801511:	78 04                	js     801517 <readn+0x3f>
			return m;
		if (m == 0)
  801513:	75 dd                	jne    8014f2 <readn+0x1a>
  801515:	eb 02                	jmp    801519 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801517:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801519:	89 d8                	mov    %ebx,%eax
  80151b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80151e:	5b                   	pop    %ebx
  80151f:	5e                   	pop    %esi
  801520:	5f                   	pop    %edi
  801521:	5d                   	pop    %ebp
  801522:	c3                   	ret    

00801523 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  801523:	f3 0f 1e fb          	endbr32 
  801527:	55                   	push   %ebp
  801528:	89 e5                	mov    %esp,%ebp
  80152a:	53                   	push   %ebx
  80152b:	83 ec 1c             	sub    $0x1c,%esp
  80152e:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801531:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801534:	50                   	push   %eax
  801535:	53                   	push   %ebx
  801536:	e8 8f fc ff ff       	call   8011ca <fd_lookup>
  80153b:	83 c4 10             	add    $0x10,%esp
  80153e:	85 c0                	test   %eax,%eax
  801540:	78 3a                	js     80157c <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  801542:	83 ec 08             	sub    $0x8,%esp
  801545:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801548:	50                   	push   %eax
  801549:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80154c:	ff 30                	pushl  (%eax)
  80154e:	e8 cb fc ff ff       	call   80121e <dev_lookup>
  801553:	83 c4 10             	add    $0x10,%esp
  801556:	85 c0                	test   %eax,%eax
  801558:	78 22                	js     80157c <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80155a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80155d:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801561:	74 1e                	je     801581 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  801563:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801566:	8b 52 0c             	mov    0xc(%edx),%edx
  801569:	85 d2                	test   %edx,%edx
  80156b:	74 35                	je     8015a2 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  80156d:	83 ec 04             	sub    $0x4,%esp
  801570:	ff 75 10             	pushl  0x10(%ebp)
  801573:	ff 75 0c             	pushl  0xc(%ebp)
  801576:	50                   	push   %eax
  801577:	ff d2                	call   *%edx
  801579:	83 c4 10             	add    $0x10,%esp
}
  80157c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80157f:	c9                   	leave  
  801580:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  801581:	a1 90 67 80 00       	mov    0x806790,%eax
  801586:	8b 40 48             	mov    0x48(%eax),%eax
  801589:	83 ec 04             	sub    $0x4,%esp
  80158c:	53                   	push   %ebx
  80158d:	50                   	push   %eax
  80158e:	68 29 2c 80 00       	push   $0x802c29
  801593:	e8 81 ef ff ff       	call   800519 <cprintf>
		return -E_INVAL;
  801598:	83 c4 10             	add    $0x10,%esp
  80159b:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8015a0:	eb da                	jmp    80157c <write+0x59>
		return -E_NOT_SUPP;
  8015a2:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8015a7:	eb d3                	jmp    80157c <write+0x59>

008015a9 <seek>:

int
seek(int fdnum, off_t offset)
{
  8015a9:	f3 0f 1e fb          	endbr32 
  8015ad:	55                   	push   %ebp
  8015ae:	89 e5                	mov    %esp,%ebp
  8015b0:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8015b3:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8015b6:	50                   	push   %eax
  8015b7:	ff 75 08             	pushl  0x8(%ebp)
  8015ba:	e8 0b fc ff ff       	call   8011ca <fd_lookup>
  8015bf:	83 c4 10             	add    $0x10,%esp
  8015c2:	85 c0                	test   %eax,%eax
  8015c4:	78 0e                	js     8015d4 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  8015c6:	8b 55 0c             	mov    0xc(%ebp),%edx
  8015c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8015cc:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  8015cf:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8015d4:	c9                   	leave  
  8015d5:	c3                   	ret    

008015d6 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  8015d6:	f3 0f 1e fb          	endbr32 
  8015da:	55                   	push   %ebp
  8015db:	89 e5                	mov    %esp,%ebp
  8015dd:	53                   	push   %ebx
  8015de:	83 ec 1c             	sub    $0x1c,%esp
  8015e1:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  8015e4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8015e7:	50                   	push   %eax
  8015e8:	53                   	push   %ebx
  8015e9:	e8 dc fb ff ff       	call   8011ca <fd_lookup>
  8015ee:	83 c4 10             	add    $0x10,%esp
  8015f1:	85 c0                	test   %eax,%eax
  8015f3:	78 37                	js     80162c <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8015f5:	83 ec 08             	sub    $0x8,%esp
  8015f8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8015fb:	50                   	push   %eax
  8015fc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8015ff:	ff 30                	pushl  (%eax)
  801601:	e8 18 fc ff ff       	call   80121e <dev_lookup>
  801606:	83 c4 10             	add    $0x10,%esp
  801609:	85 c0                	test   %eax,%eax
  80160b:	78 1f                	js     80162c <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80160d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801610:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801614:	74 1b                	je     801631 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  801616:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801619:	8b 52 18             	mov    0x18(%edx),%edx
  80161c:	85 d2                	test   %edx,%edx
  80161e:	74 32                	je     801652 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801620:	83 ec 08             	sub    $0x8,%esp
  801623:	ff 75 0c             	pushl  0xc(%ebp)
  801626:	50                   	push   %eax
  801627:	ff d2                	call   *%edx
  801629:	83 c4 10             	add    $0x10,%esp
}
  80162c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80162f:	c9                   	leave  
  801630:	c3                   	ret    
			thisenv->env_id, fdnum);
  801631:	a1 90 67 80 00       	mov    0x806790,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  801636:	8b 40 48             	mov    0x48(%eax),%eax
  801639:	83 ec 04             	sub    $0x4,%esp
  80163c:	53                   	push   %ebx
  80163d:	50                   	push   %eax
  80163e:	68 ec 2b 80 00       	push   $0x802bec
  801643:	e8 d1 ee ff ff       	call   800519 <cprintf>
		return -E_INVAL;
  801648:	83 c4 10             	add    $0x10,%esp
  80164b:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801650:	eb da                	jmp    80162c <ftruncate+0x56>
		return -E_NOT_SUPP;
  801652:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801657:	eb d3                	jmp    80162c <ftruncate+0x56>

00801659 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  801659:	f3 0f 1e fb          	endbr32 
  80165d:	55                   	push   %ebp
  80165e:	89 e5                	mov    %esp,%ebp
  801660:	53                   	push   %ebx
  801661:	83 ec 1c             	sub    $0x1c,%esp
  801664:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801667:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80166a:	50                   	push   %eax
  80166b:	ff 75 08             	pushl  0x8(%ebp)
  80166e:	e8 57 fb ff ff       	call   8011ca <fd_lookup>
  801673:	83 c4 10             	add    $0x10,%esp
  801676:	85 c0                	test   %eax,%eax
  801678:	78 4b                	js     8016c5 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80167a:	83 ec 08             	sub    $0x8,%esp
  80167d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801680:	50                   	push   %eax
  801681:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801684:	ff 30                	pushl  (%eax)
  801686:	e8 93 fb ff ff       	call   80121e <dev_lookup>
  80168b:	83 c4 10             	add    $0x10,%esp
  80168e:	85 c0                	test   %eax,%eax
  801690:	78 33                	js     8016c5 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  801692:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801695:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  801699:	74 2f                	je     8016ca <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  80169b:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  80169e:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  8016a5:	00 00 00 
	stat->st_isdir = 0;
  8016a8:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  8016af:	00 00 00 
	stat->st_dev = dev;
  8016b2:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  8016b8:	83 ec 08             	sub    $0x8,%esp
  8016bb:	53                   	push   %ebx
  8016bc:	ff 75 f0             	pushl  -0x10(%ebp)
  8016bf:	ff 50 14             	call   *0x14(%eax)
  8016c2:	83 c4 10             	add    $0x10,%esp
}
  8016c5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8016c8:	c9                   	leave  
  8016c9:	c3                   	ret    
		return -E_NOT_SUPP;
  8016ca:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8016cf:	eb f4                	jmp    8016c5 <fstat+0x6c>

008016d1 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  8016d1:	f3 0f 1e fb          	endbr32 
  8016d5:	55                   	push   %ebp
  8016d6:	89 e5                	mov    %esp,%ebp
  8016d8:	56                   	push   %esi
  8016d9:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  8016da:	83 ec 08             	sub    $0x8,%esp
  8016dd:	6a 00                	push   $0x0
  8016df:	ff 75 08             	pushl  0x8(%ebp)
  8016e2:	e8 fb 01 00 00       	call   8018e2 <open>
  8016e7:	89 c3                	mov    %eax,%ebx
  8016e9:	83 c4 10             	add    $0x10,%esp
  8016ec:	85 c0                	test   %eax,%eax
  8016ee:	78 1b                	js     80170b <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  8016f0:	83 ec 08             	sub    $0x8,%esp
  8016f3:	ff 75 0c             	pushl  0xc(%ebp)
  8016f6:	50                   	push   %eax
  8016f7:	e8 5d ff ff ff       	call   801659 <fstat>
  8016fc:	89 c6                	mov    %eax,%esi
	close(fd);
  8016fe:	89 1c 24             	mov    %ebx,(%esp)
  801701:	e8 fd fb ff ff       	call   801303 <close>
	return r;
  801706:	83 c4 10             	add    $0x10,%esp
  801709:	89 f3                	mov    %esi,%ebx
}
  80170b:	89 d8                	mov    %ebx,%eax
  80170d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801710:	5b                   	pop    %ebx
  801711:	5e                   	pop    %esi
  801712:	5d                   	pop    %ebp
  801713:	c3                   	ret    

00801714 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  801714:	55                   	push   %ebp
  801715:	89 e5                	mov    %esp,%ebp
  801717:	56                   	push   %esi
  801718:	53                   	push   %ebx
  801719:	89 c6                	mov    %eax,%esi
  80171b:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  80171d:	83 3d 00 50 80 00 00 	cmpl   $0x0,0x805000
  801724:	74 27                	je     80174d <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  801726:	6a 07                	push   $0x7
  801728:	68 00 70 80 00       	push   $0x807000
  80172d:	56                   	push   %esi
  80172e:	ff 35 00 50 80 00    	pushl  0x805000
  801734:	e8 9c 0c 00 00       	call   8023d5 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  801739:	83 c4 0c             	add    $0xc,%esp
  80173c:	6a 00                	push   $0x0
  80173e:	53                   	push   %ebx
  80173f:	6a 00                	push   $0x0
  801741:	e8 0e 0c 00 00       	call   802354 <ipc_recv>
}
  801746:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801749:	5b                   	pop    %ebx
  80174a:	5e                   	pop    %esi
  80174b:	5d                   	pop    %ebp
  80174c:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  80174d:	83 ec 0c             	sub    $0xc,%esp
  801750:	6a 01                	push   $0x1
  801752:	e8 d6 0c 00 00       	call   80242d <ipc_find_env>
  801757:	a3 00 50 80 00       	mov    %eax,0x805000
  80175c:	83 c4 10             	add    $0x10,%esp
  80175f:	eb c5                	jmp    801726 <fsipc+0x12>

00801761 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  801761:	f3 0f 1e fb          	endbr32 
  801765:	55                   	push   %ebp
  801766:	89 e5                	mov    %esp,%ebp
  801768:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  80176b:	8b 45 08             	mov    0x8(%ebp),%eax
  80176e:	8b 40 0c             	mov    0xc(%eax),%eax
  801771:	a3 00 70 80 00       	mov    %eax,0x807000
	fsipcbuf.set_size.req_size = newsize;
  801776:	8b 45 0c             	mov    0xc(%ebp),%eax
  801779:	a3 04 70 80 00       	mov    %eax,0x807004
	return fsipc(FSREQ_SET_SIZE, NULL);
  80177e:	ba 00 00 00 00       	mov    $0x0,%edx
  801783:	b8 02 00 00 00       	mov    $0x2,%eax
  801788:	e8 87 ff ff ff       	call   801714 <fsipc>
}
  80178d:	c9                   	leave  
  80178e:	c3                   	ret    

0080178f <devfile_flush>:
{
  80178f:	f3 0f 1e fb          	endbr32 
  801793:	55                   	push   %ebp
  801794:	89 e5                	mov    %esp,%ebp
  801796:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  801799:	8b 45 08             	mov    0x8(%ebp),%eax
  80179c:	8b 40 0c             	mov    0xc(%eax),%eax
  80179f:	a3 00 70 80 00       	mov    %eax,0x807000
	return fsipc(FSREQ_FLUSH, NULL);
  8017a4:	ba 00 00 00 00       	mov    $0x0,%edx
  8017a9:	b8 06 00 00 00       	mov    $0x6,%eax
  8017ae:	e8 61 ff ff ff       	call   801714 <fsipc>
}
  8017b3:	c9                   	leave  
  8017b4:	c3                   	ret    

008017b5 <devfile_stat>:
{
  8017b5:	f3 0f 1e fb          	endbr32 
  8017b9:	55                   	push   %ebp
  8017ba:	89 e5                	mov    %esp,%ebp
  8017bc:	53                   	push   %ebx
  8017bd:	83 ec 04             	sub    $0x4,%esp
  8017c0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  8017c3:	8b 45 08             	mov    0x8(%ebp),%eax
  8017c6:	8b 40 0c             	mov    0xc(%eax),%eax
  8017c9:	a3 00 70 80 00       	mov    %eax,0x807000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  8017ce:	ba 00 00 00 00       	mov    $0x0,%edx
  8017d3:	b8 05 00 00 00       	mov    $0x5,%eax
  8017d8:	e8 37 ff ff ff       	call   801714 <fsipc>
  8017dd:	85 c0                	test   %eax,%eax
  8017df:	78 2c                	js     80180d <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  8017e1:	83 ec 08             	sub    $0x8,%esp
  8017e4:	68 00 70 80 00       	push   $0x807000
  8017e9:	53                   	push   %ebx
  8017ea:	e8 03 f3 ff ff       	call   800af2 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  8017ef:	a1 80 70 80 00       	mov    0x807080,%eax
  8017f4:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  8017fa:	a1 84 70 80 00       	mov    0x807084,%eax
  8017ff:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  801805:	83 c4 10             	add    $0x10,%esp
  801808:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80180d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801810:	c9                   	leave  
  801811:	c3                   	ret    

00801812 <devfile_write>:
{
  801812:	f3 0f 1e fb          	endbr32 
  801816:	55                   	push   %ebp
  801817:	89 e5                	mov    %esp,%ebp
  801819:	83 ec 0c             	sub    $0xc,%esp
  80181c:	8b 45 10             	mov    0x10(%ebp),%eax
  80181f:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  801824:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801829:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  80182c:	8b 55 08             	mov    0x8(%ebp),%edx
  80182f:	8b 52 0c             	mov    0xc(%edx),%edx
  801832:	89 15 00 70 80 00    	mov    %edx,0x807000
	fsipcbuf.write.req_n = n;
  801838:	a3 04 70 80 00       	mov    %eax,0x807004
	memmove(fsipcbuf.write.req_buf, buf, n);
  80183d:	50                   	push   %eax
  80183e:	ff 75 0c             	pushl  0xc(%ebp)
  801841:	68 08 70 80 00       	push   $0x807008
  801846:	e8 5d f4 ff ff       	call   800ca8 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  80184b:	ba 00 00 00 00       	mov    $0x0,%edx
  801850:	b8 04 00 00 00       	mov    $0x4,%eax
  801855:	e8 ba fe ff ff       	call   801714 <fsipc>
  80185a:	c9                   	leave  
  80185b:	c3                   	ret    

0080185c <devfile_read>:
{
  80185c:	f3 0f 1e fb          	endbr32 
  801860:	55                   	push   %ebp
  801861:	89 e5                	mov    %esp,%ebp
  801863:	56                   	push   %esi
  801864:	53                   	push   %ebx
  801865:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  801868:	8b 45 08             	mov    0x8(%ebp),%eax
  80186b:	8b 40 0c             	mov    0xc(%eax),%eax
  80186e:	a3 00 70 80 00       	mov    %eax,0x807000
	fsipcbuf.read.req_n = n;
  801873:	89 35 04 70 80 00    	mov    %esi,0x807004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  801879:	ba 00 00 00 00       	mov    $0x0,%edx
  80187e:	b8 03 00 00 00       	mov    $0x3,%eax
  801883:	e8 8c fe ff ff       	call   801714 <fsipc>
  801888:	89 c3                	mov    %eax,%ebx
  80188a:	85 c0                	test   %eax,%eax
  80188c:	78 1f                	js     8018ad <devfile_read+0x51>
	assert(r <= n);
  80188e:	39 f0                	cmp    %esi,%eax
  801890:	77 24                	ja     8018b6 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  801892:	3d 00 10 00 00       	cmp    $0x1000,%eax
  801897:	7f 33                	jg     8018cc <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  801899:	83 ec 04             	sub    $0x4,%esp
  80189c:	50                   	push   %eax
  80189d:	68 00 70 80 00       	push   $0x807000
  8018a2:	ff 75 0c             	pushl  0xc(%ebp)
  8018a5:	e8 fe f3 ff ff       	call   800ca8 <memmove>
	return r;
  8018aa:	83 c4 10             	add    $0x10,%esp
}
  8018ad:	89 d8                	mov    %ebx,%eax
  8018af:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8018b2:	5b                   	pop    %ebx
  8018b3:	5e                   	pop    %esi
  8018b4:	5d                   	pop    %ebp
  8018b5:	c3                   	ret    
	assert(r <= n);
  8018b6:	68 58 2c 80 00       	push   $0x802c58
  8018bb:	68 5f 2c 80 00       	push   $0x802c5f
  8018c0:	6a 7c                	push   $0x7c
  8018c2:	68 74 2c 80 00       	push   $0x802c74
  8018c7:	e8 66 eb ff ff       	call   800432 <_panic>
	assert(r <= PGSIZE);
  8018cc:	68 7f 2c 80 00       	push   $0x802c7f
  8018d1:	68 5f 2c 80 00       	push   $0x802c5f
  8018d6:	6a 7d                	push   $0x7d
  8018d8:	68 74 2c 80 00       	push   $0x802c74
  8018dd:	e8 50 eb ff ff       	call   800432 <_panic>

008018e2 <open>:
{
  8018e2:	f3 0f 1e fb          	endbr32 
  8018e6:	55                   	push   %ebp
  8018e7:	89 e5                	mov    %esp,%ebp
  8018e9:	56                   	push   %esi
  8018ea:	53                   	push   %ebx
  8018eb:	83 ec 1c             	sub    $0x1c,%esp
  8018ee:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  8018f1:	56                   	push   %esi
  8018f2:	e8 b8 f1 ff ff       	call   800aaf <strlen>
  8018f7:	83 c4 10             	add    $0x10,%esp
  8018fa:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  8018ff:	7f 6c                	jg     80196d <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801901:	83 ec 0c             	sub    $0xc,%esp
  801904:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801907:	50                   	push   %eax
  801908:	e8 67 f8 ff ff       	call   801174 <fd_alloc>
  80190d:	89 c3                	mov    %eax,%ebx
  80190f:	83 c4 10             	add    $0x10,%esp
  801912:	85 c0                	test   %eax,%eax
  801914:	78 3c                	js     801952 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  801916:	83 ec 08             	sub    $0x8,%esp
  801919:	56                   	push   %esi
  80191a:	68 00 70 80 00       	push   $0x807000
  80191f:	e8 ce f1 ff ff       	call   800af2 <strcpy>
	fsipcbuf.open.req_omode = mode;
  801924:	8b 45 0c             	mov    0xc(%ebp),%eax
  801927:	a3 00 74 80 00       	mov    %eax,0x807400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  80192c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80192f:	b8 01 00 00 00       	mov    $0x1,%eax
  801934:	e8 db fd ff ff       	call   801714 <fsipc>
  801939:	89 c3                	mov    %eax,%ebx
  80193b:	83 c4 10             	add    $0x10,%esp
  80193e:	85 c0                	test   %eax,%eax
  801940:	78 19                	js     80195b <open+0x79>
	return fd2num(fd);
  801942:	83 ec 0c             	sub    $0xc,%esp
  801945:	ff 75 f4             	pushl  -0xc(%ebp)
  801948:	e8 f8 f7 ff ff       	call   801145 <fd2num>
  80194d:	89 c3                	mov    %eax,%ebx
  80194f:	83 c4 10             	add    $0x10,%esp
}
  801952:	89 d8                	mov    %ebx,%eax
  801954:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801957:	5b                   	pop    %ebx
  801958:	5e                   	pop    %esi
  801959:	5d                   	pop    %ebp
  80195a:	c3                   	ret    
		fd_close(fd, 0);
  80195b:	83 ec 08             	sub    $0x8,%esp
  80195e:	6a 00                	push   $0x0
  801960:	ff 75 f4             	pushl  -0xc(%ebp)
  801963:	e8 10 f9 ff ff       	call   801278 <fd_close>
		return r;
  801968:	83 c4 10             	add    $0x10,%esp
  80196b:	eb e5                	jmp    801952 <open+0x70>
		return -E_BAD_PATH;
  80196d:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  801972:	eb de                	jmp    801952 <open+0x70>

00801974 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  801974:	f3 0f 1e fb          	endbr32 
  801978:	55                   	push   %ebp
  801979:	89 e5                	mov    %esp,%ebp
  80197b:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  80197e:	ba 00 00 00 00       	mov    $0x0,%edx
  801983:	b8 08 00 00 00       	mov    $0x8,%eax
  801988:	e8 87 fd ff ff       	call   801714 <fsipc>
}
  80198d:	c9                   	leave  
  80198e:	c3                   	ret    

0080198f <spawn>:
// argv: pointer to null-terminated array of pointers to strings,
// 	 which will be passed to the child as its command-line arguments.
// Returns child envid on success, < 0 on failure.
int
spawn(const char *prog, const char **argv)
{
  80198f:	f3 0f 1e fb          	endbr32 
  801993:	55                   	push   %ebp
  801994:	89 e5                	mov    %esp,%ebp
  801996:	57                   	push   %edi
  801997:	56                   	push   %esi
  801998:	53                   	push   %ebx
  801999:	81 ec 94 02 00 00    	sub    $0x294,%esp
	//   - Call sys_env_set_trapframe(child, &child_tf) to set up the
	//     correct initial eip and esp values in the child.
	//
	//   - Start the child process running with sys_env_set_status().

	if ((r = open(prog, O_RDONLY)) < 0)
  80199f:	6a 00                	push   $0x0
  8019a1:	ff 75 08             	pushl  0x8(%ebp)
  8019a4:	e8 39 ff ff ff       	call   8018e2 <open>
  8019a9:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  8019af:	83 c4 10             	add    $0x10,%esp
  8019b2:	85 c0                	test   %eax,%eax
  8019b4:	0f 88 e5 04 00 00    	js     801e9f <spawn+0x510>
  8019ba:	89 c1                	mov    %eax,%ecx
		return r;
	fd = r;

	// Read elf header
	elf = (struct Elf*) elf_buf;
	if (readn(fd, elf_buf, sizeof(elf_buf)) != sizeof(elf_buf)
  8019bc:	83 ec 04             	sub    $0x4,%esp
  8019bf:	68 00 02 00 00       	push   $0x200
  8019c4:	8d 85 e8 fd ff ff    	lea    -0x218(%ebp),%eax
  8019ca:	50                   	push   %eax
  8019cb:	51                   	push   %ecx
  8019cc:	e8 07 fb ff ff       	call   8014d8 <readn>
  8019d1:	83 c4 10             	add    $0x10,%esp
  8019d4:	3d 00 02 00 00       	cmp    $0x200,%eax
  8019d9:	75 7e                	jne    801a59 <spawn+0xca>
	    || elf->e_magic != ELF_MAGIC) {
  8019db:	81 bd e8 fd ff ff 7f 	cmpl   $0x464c457f,-0x218(%ebp)
  8019e2:	45 4c 46 
  8019e5:	75 72                	jne    801a59 <spawn+0xca>
// This must be inlined.  Exercise for reader: why?
static inline envid_t __attribute__((always_inline))
sys_exofork(void)
{
	envid_t ret;
	asm volatile("int %2"
  8019e7:	b8 07 00 00 00       	mov    $0x7,%eax
  8019ec:	cd 30                	int    $0x30
  8019ee:	89 85 74 fd ff ff    	mov    %eax,-0x28c(%ebp)
  8019f4:	89 85 88 fd ff ff    	mov    %eax,-0x278(%ebp)
		cprintf("elf magic %08x want %08x\n", elf->e_magic, ELF_MAGIC);
		return -E_NOT_EXEC;
	}

	// Create new child environment
	if ((r = sys_exofork()) < 0)
  8019fa:	85 c0                	test   %eax,%eax
  8019fc:	0f 88 91 04 00 00    	js     801e93 <spawn+0x504>
		return r;
	child = r;

	// Set up trap frame, including initial stack.
	child_tf = envs[ENVX(child)].env_tf;
  801a02:	25 ff 03 00 00       	and    $0x3ff,%eax
  801a07:	6b f0 7c             	imul   $0x7c,%eax,%esi
  801a0a:	81 c6 00 00 c0 ee    	add    $0xeec00000,%esi
  801a10:	8d bd a4 fd ff ff    	lea    -0x25c(%ebp),%edi
  801a16:	b9 11 00 00 00       	mov    $0x11,%ecx
  801a1b:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
	child_tf.tf_eip = elf->e_entry;
  801a1d:	8b 85 00 fe ff ff    	mov    -0x200(%ebp),%eax
  801a23:	89 85 d4 fd ff ff    	mov    %eax,-0x22c(%ebp)
	uintptr_t *argv_store;

	// Count the number of arguments (argc)
	// and the total amount of space needed for strings (string_size).
	string_size = 0;
	for (argc = 0; argv[argc] != 0; argc++)
  801a29:	bb 00 00 00 00       	mov    $0x0,%ebx
	string_size = 0;
  801a2e:	be 00 00 00 00       	mov    $0x0,%esi
  801a33:	8b 7d 0c             	mov    0xc(%ebp),%edi
  801a36:	8d 0c 9d 00 00 00 00 	lea    0x0(,%ebx,4),%ecx
	for (argc = 0; argv[argc] != 0; argc++)
  801a3d:	8b 04 9f             	mov    (%edi,%ebx,4),%eax
  801a40:	85 c0                	test   %eax,%eax
  801a42:	74 4d                	je     801a91 <spawn+0x102>
		string_size += strlen(argv[argc]) + 1;
  801a44:	83 ec 0c             	sub    $0xc,%esp
  801a47:	50                   	push   %eax
  801a48:	e8 62 f0 ff ff       	call   800aaf <strlen>
  801a4d:	8d 74 06 01          	lea    0x1(%esi,%eax,1),%esi
	for (argc = 0; argv[argc] != 0; argc++)
  801a51:	83 c3 01             	add    $0x1,%ebx
  801a54:	83 c4 10             	add    $0x10,%esp
  801a57:	eb dd                	jmp    801a36 <spawn+0xa7>
		close(fd);
  801a59:	83 ec 0c             	sub    $0xc,%esp
  801a5c:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801a62:	e8 9c f8 ff ff       	call   801303 <close>
		cprintf("elf magic %08x want %08x\n", elf->e_magic, ELF_MAGIC);
  801a67:	83 c4 0c             	add    $0xc,%esp
  801a6a:	68 7f 45 4c 46       	push   $0x464c457f
  801a6f:	ff b5 e8 fd ff ff    	pushl  -0x218(%ebp)
  801a75:	68 8b 2c 80 00       	push   $0x802c8b
  801a7a:	e8 9a ea ff ff       	call   800519 <cprintf>
		return -E_NOT_EXEC;
  801a7f:	83 c4 10             	add    $0x10,%esp
  801a82:	c7 85 94 fd ff ff f2 	movl   $0xfffffff2,-0x26c(%ebp)
  801a89:	ff ff ff 
  801a8c:	e9 0e 04 00 00       	jmp    801e9f <spawn+0x510>
  801a91:	89 9d 84 fd ff ff    	mov    %ebx,-0x27c(%ebp)
  801a97:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
	// Determine where to place the strings and the argv array.
	// Set up pointers into the temporary page 'UTEMP'; we'll map a page
	// there later, then remap that page into the child environment
	// at (USTACKTOP - PGSIZE).
	// strings is the topmost thing on the stack.
	string_store = (char*) UTEMP + PGSIZE - string_size;
  801a9d:	bf 00 10 40 00       	mov    $0x401000,%edi
  801aa2:	29 f7                	sub    %esi,%edi
	// argv is below that.  There's one argument pointer per argument, plus
	// a null pointer.
	argv_store = (uintptr_t*) (ROUNDDOWN(string_store, 4) - 4 * (argc + 1));
  801aa4:	89 fa                	mov    %edi,%edx
  801aa6:	83 e2 fc             	and    $0xfffffffc,%edx
  801aa9:	8d 04 9d 04 00 00 00 	lea    0x4(,%ebx,4),%eax
  801ab0:	29 c2                	sub    %eax,%edx
  801ab2:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)

	// Make sure that argv, strings, and the 2 words that hold 'argc'
	// and 'argv' themselves will all fit in a single stack page.
	if ((void*) (argv_store - 2) < (void*) UTEMP)
  801ab8:	8d 42 f8             	lea    -0x8(%edx),%eax
  801abb:	3d ff ff 3f 00       	cmp    $0x3fffff,%eax
  801ac0:	0f 86 fc 03 00 00    	jbe    801ec2 <spawn+0x533>
		return -E_NO_MEM;

	// Allocate the single stack page at UTEMP.
	if ((r = sys_page_alloc(0, (void*) UTEMP, PTE_P|PTE_U|PTE_W)) < 0)
  801ac6:	83 ec 04             	sub    $0x4,%esp
  801ac9:	6a 07                	push   $0x7
  801acb:	68 00 00 40 00       	push   $0x400000
  801ad0:	6a 00                	push   $0x0
  801ad2:	e8 5d f4 ff ff       	call   800f34 <sys_page_alloc>
  801ad7:	83 c4 10             	add    $0x10,%esp
  801ada:	85 c0                	test   %eax,%eax
  801adc:	0f 88 e5 03 00 00    	js     801ec7 <spawn+0x538>
	//	  (Again, argv should use an address valid in the child's
	//	  environment.)
	//
	//	* Set *init_esp to the initial stack pointer for the child,
	//	  (Again, use an address valid in the child's environment.)
	for (i = 0; i < argc; i++) {
  801ae2:	be 00 00 00 00       	mov    $0x0,%esi
  801ae7:	89 9d 8c fd ff ff    	mov    %ebx,-0x274(%ebp)
  801aed:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  801af0:	eb 30                	jmp    801b22 <spawn+0x193>
		argv_store[i] = UTEMP2USTACK(string_store);
  801af2:	8d 87 00 d0 7f ee    	lea    -0x11803000(%edi),%eax
  801af8:	8b 8d 90 fd ff ff    	mov    -0x270(%ebp),%ecx
  801afe:	89 04 b1             	mov    %eax,(%ecx,%esi,4)
		strcpy(string_store, argv[i]);
  801b01:	83 ec 08             	sub    $0x8,%esp
  801b04:	ff 34 b3             	pushl  (%ebx,%esi,4)
  801b07:	57                   	push   %edi
  801b08:	e8 e5 ef ff ff       	call   800af2 <strcpy>
		string_store += strlen(argv[i]) + 1;
  801b0d:	83 c4 04             	add    $0x4,%esp
  801b10:	ff 34 b3             	pushl  (%ebx,%esi,4)
  801b13:	e8 97 ef ff ff       	call   800aaf <strlen>
  801b18:	8d 7c 07 01          	lea    0x1(%edi,%eax,1),%edi
	for (i = 0; i < argc; i++) {
  801b1c:	83 c6 01             	add    $0x1,%esi
  801b1f:	83 c4 10             	add    $0x10,%esp
  801b22:	39 b5 8c fd ff ff    	cmp    %esi,-0x274(%ebp)
  801b28:	7f c8                	jg     801af2 <spawn+0x163>
	}
	argv_store[argc] = 0;
  801b2a:	8b 85 90 fd ff ff    	mov    -0x270(%ebp),%eax
  801b30:	8b 8d 80 fd ff ff    	mov    -0x280(%ebp),%ecx
  801b36:	c7 04 08 00 00 00 00 	movl   $0x0,(%eax,%ecx,1)
	assert(string_store == (char*)UTEMP + PGSIZE);
  801b3d:	81 ff 00 10 40 00    	cmp    $0x401000,%edi
  801b43:	0f 85 86 00 00 00    	jne    801bcf <spawn+0x240>

	argv_store[-1] = UTEMP2USTACK(argv_store);
  801b49:	8b 95 90 fd ff ff    	mov    -0x270(%ebp),%edx
  801b4f:	8d 82 00 d0 7f ee    	lea    -0x11803000(%edx),%eax
  801b55:	89 42 fc             	mov    %eax,-0x4(%edx)
	argv_store[-2] = argc;
  801b58:	89 d0                	mov    %edx,%eax
  801b5a:	8b 8d 84 fd ff ff    	mov    -0x27c(%ebp),%ecx
  801b60:	89 4a f8             	mov    %ecx,-0x8(%edx)

	*init_esp = UTEMP2USTACK(&argv_store[-2]);
  801b63:	2d 08 30 80 11       	sub    $0x11803008,%eax
  801b68:	89 85 e0 fd ff ff    	mov    %eax,-0x220(%ebp)

	// After completing the stack, map it into the child's address space
	// and unmap it from ours!
	if ((r = sys_page_map(0, UTEMP, child, (void*) (USTACKTOP - PGSIZE), PTE_P | PTE_U | PTE_W)) < 0)
  801b6e:	83 ec 0c             	sub    $0xc,%esp
  801b71:	6a 07                	push   $0x7
  801b73:	68 00 d0 bf ee       	push   $0xeebfd000
  801b78:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801b7e:	68 00 00 40 00       	push   $0x400000
  801b83:	6a 00                	push   $0x0
  801b85:	e8 f1 f3 ff ff       	call   800f7b <sys_page_map>
  801b8a:	89 c3                	mov    %eax,%ebx
  801b8c:	83 c4 20             	add    $0x20,%esp
  801b8f:	85 c0                	test   %eax,%eax
  801b91:	0f 88 38 03 00 00    	js     801ecf <spawn+0x540>
		goto error;
	if ((r = sys_page_unmap(0, UTEMP)) < 0)
  801b97:	83 ec 08             	sub    $0x8,%esp
  801b9a:	68 00 00 40 00       	push   $0x400000
  801b9f:	6a 00                	push   $0x0
  801ba1:	e8 1b f4 ff ff       	call   800fc1 <sys_page_unmap>
  801ba6:	89 c3                	mov    %eax,%ebx
  801ba8:	83 c4 10             	add    $0x10,%esp
  801bab:	85 c0                	test   %eax,%eax
  801bad:	0f 88 1c 03 00 00    	js     801ecf <spawn+0x540>
	ph = (struct Proghdr*) (elf_buf + elf->e_phoff);
  801bb3:	8b 85 04 fe ff ff    	mov    -0x1fc(%ebp),%eax
  801bb9:	8d b4 05 e8 fd ff ff 	lea    -0x218(%ebp,%eax,1),%esi
	for (i = 0; i < elf->e_phnum; i++, ph++) {
  801bc0:	c7 85 84 fd ff ff 00 	movl   $0x0,-0x27c(%ebp)
  801bc7:	00 00 00 
  801bca:	e9 4f 01 00 00       	jmp    801d1e <spawn+0x38f>
	assert(string_store == (char*)UTEMP + PGSIZE);
  801bcf:	68 00 2d 80 00       	push   $0x802d00
  801bd4:	68 5f 2c 80 00       	push   $0x802c5f
  801bd9:	68 f2 00 00 00       	push   $0xf2
  801bde:	68 a5 2c 80 00       	push   $0x802ca5
  801be3:	e8 4a e8 ff ff       	call   800432 <_panic>
			// allocate a blank page
			if ((r = sys_page_alloc(child, (void*) (va + i), perm)) < 0)
				return r;
		} else {
			// from file
			if ((r = sys_page_alloc(0, UTEMP, PTE_P|PTE_U|PTE_W)) < 0)
  801be8:	83 ec 04             	sub    $0x4,%esp
  801beb:	6a 07                	push   $0x7
  801bed:	68 00 00 40 00       	push   $0x400000
  801bf2:	6a 00                	push   $0x0
  801bf4:	e8 3b f3 ff ff       	call   800f34 <sys_page_alloc>
  801bf9:	83 c4 10             	add    $0x10,%esp
  801bfc:	85 c0                	test   %eax,%eax
  801bfe:	0f 88 a9 02 00 00    	js     801ead <spawn+0x51e>
				return r;
			if ((r = seek(fd, fileoffset + i)) < 0)
  801c04:	83 ec 08             	sub    $0x8,%esp
  801c07:	8b 85 80 fd ff ff    	mov    -0x280(%ebp),%eax
  801c0d:	01 f0                	add    %esi,%eax
  801c0f:	50                   	push   %eax
  801c10:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801c16:	e8 8e f9 ff ff       	call   8015a9 <seek>
  801c1b:	83 c4 10             	add    $0x10,%esp
  801c1e:	85 c0                	test   %eax,%eax
  801c20:	0f 88 8e 02 00 00    	js     801eb4 <spawn+0x525>
				return r;
			if ((r = readn(fd, UTEMP, MIN(PGSIZE, filesz-i))) < 0)
  801c26:	83 ec 04             	sub    $0x4,%esp
  801c29:	8b 85 90 fd ff ff    	mov    -0x270(%ebp),%eax
  801c2f:	29 f0                	sub    %esi,%eax
  801c31:	3d 00 10 00 00       	cmp    $0x1000,%eax
  801c36:	b9 00 10 00 00       	mov    $0x1000,%ecx
  801c3b:	0f 47 c1             	cmova  %ecx,%eax
  801c3e:	50                   	push   %eax
  801c3f:	68 00 00 40 00       	push   $0x400000
  801c44:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801c4a:	e8 89 f8 ff ff       	call   8014d8 <readn>
  801c4f:	83 c4 10             	add    $0x10,%esp
  801c52:	85 c0                	test   %eax,%eax
  801c54:	0f 88 61 02 00 00    	js     801ebb <spawn+0x52c>
				return r;
			if ((r = sys_page_map(0, UTEMP, child, (void*) (va + i), perm)) < 0)
  801c5a:	83 ec 0c             	sub    $0xc,%esp
  801c5d:	ff b5 8c fd ff ff    	pushl  -0x274(%ebp)
  801c63:	53                   	push   %ebx
  801c64:	ff b5 88 fd ff ff    	pushl  -0x278(%ebp)
  801c6a:	68 00 00 40 00       	push   $0x400000
  801c6f:	6a 00                	push   $0x0
  801c71:	e8 05 f3 ff ff       	call   800f7b <sys_page_map>
  801c76:	83 c4 20             	add    $0x20,%esp
  801c79:	85 c0                	test   %eax,%eax
  801c7b:	78 7c                	js     801cf9 <spawn+0x36a>
				panic("spawn: sys_page_map data: %e", r);
			sys_page_unmap(0, UTEMP);
  801c7d:	83 ec 08             	sub    $0x8,%esp
  801c80:	68 00 00 40 00       	push   $0x400000
  801c85:	6a 00                	push   $0x0
  801c87:	e8 35 f3 ff ff       	call   800fc1 <sys_page_unmap>
  801c8c:	83 c4 10             	add    $0x10,%esp
	for (i = 0; i < memsz; i += PGSIZE) {
  801c8f:	81 c7 00 10 00 00    	add    $0x1000,%edi
  801c95:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  801c9b:	89 fe                	mov    %edi,%esi
  801c9d:	39 bd 7c fd ff ff    	cmp    %edi,-0x284(%ebp)
  801ca3:	76 69                	jbe    801d0e <spawn+0x37f>
		if (i >= filesz) {
  801ca5:	39 bd 90 fd ff ff    	cmp    %edi,-0x270(%ebp)
  801cab:	0f 87 37 ff ff ff    	ja     801be8 <spawn+0x259>
			if ((r = sys_page_alloc(child, (void*) (va + i), perm)) < 0)
  801cb1:	83 ec 04             	sub    $0x4,%esp
  801cb4:	ff b5 8c fd ff ff    	pushl  -0x274(%ebp)
  801cba:	53                   	push   %ebx
  801cbb:	ff b5 88 fd ff ff    	pushl  -0x278(%ebp)
  801cc1:	e8 6e f2 ff ff       	call   800f34 <sys_page_alloc>
  801cc6:	83 c4 10             	add    $0x10,%esp
  801cc9:	85 c0                	test   %eax,%eax
  801ccb:	79 c2                	jns    801c8f <spawn+0x300>
  801ccd:	89 c7                	mov    %eax,%edi
	sys_env_destroy(child);
  801ccf:	83 ec 0c             	sub    $0xc,%esp
  801cd2:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801cd8:	e8 cc f1 ff ff       	call   800ea9 <sys_env_destroy>
	close(fd);
  801cdd:	83 c4 04             	add    $0x4,%esp
  801ce0:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801ce6:	e8 18 f6 ff ff       	call   801303 <close>
	return r;
  801ceb:	83 c4 10             	add    $0x10,%esp
  801cee:	89 bd 94 fd ff ff    	mov    %edi,-0x26c(%ebp)
  801cf4:	e9 a6 01 00 00       	jmp    801e9f <spawn+0x510>
				panic("spawn: sys_page_map data: %e", r);
  801cf9:	50                   	push   %eax
  801cfa:	68 b1 2c 80 00       	push   $0x802cb1
  801cff:	68 25 01 00 00       	push   $0x125
  801d04:	68 a5 2c 80 00       	push   $0x802ca5
  801d09:	e8 24 e7 ff ff       	call   800432 <_panic>
  801d0e:	8b b5 78 fd ff ff    	mov    -0x288(%ebp),%esi
	for (i = 0; i < elf->e_phnum; i++, ph++) {
  801d14:	83 85 84 fd ff ff 01 	addl   $0x1,-0x27c(%ebp)
  801d1b:	83 c6 20             	add    $0x20,%esi
  801d1e:	0f b7 85 14 fe ff ff 	movzwl -0x1ec(%ebp),%eax
  801d25:	3b 85 84 fd ff ff    	cmp    -0x27c(%ebp),%eax
  801d2b:	7e 6d                	jle    801d9a <spawn+0x40b>
		if (ph->p_type != ELF_PROG_LOAD)
  801d2d:	83 3e 01             	cmpl   $0x1,(%esi)
  801d30:	75 e2                	jne    801d14 <spawn+0x385>
		if (ph->p_flags & ELF_PROG_FLAG_WRITE)
  801d32:	8b 46 18             	mov    0x18(%esi),%eax
  801d35:	83 e0 02             	and    $0x2,%eax
			perm |= PTE_W;
  801d38:	83 f8 01             	cmp    $0x1,%eax
  801d3b:	19 c0                	sbb    %eax,%eax
  801d3d:	83 e0 fe             	and    $0xfffffffe,%eax
  801d40:	83 c0 07             	add    $0x7,%eax
  801d43:	89 85 8c fd ff ff    	mov    %eax,-0x274(%ebp)
		if ((r = map_segment(child, ph->p_va, ph->p_memsz,
  801d49:	8b 4e 04             	mov    0x4(%esi),%ecx
  801d4c:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
  801d52:	8b 56 10             	mov    0x10(%esi),%edx
  801d55:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)
  801d5b:	8b 7e 14             	mov    0x14(%esi),%edi
  801d5e:	89 bd 7c fd ff ff    	mov    %edi,-0x284(%ebp)
  801d64:	8b 5e 08             	mov    0x8(%esi),%ebx
	if ((i = PGOFF(va))) {
  801d67:	89 d8                	mov    %ebx,%eax
  801d69:	25 ff 0f 00 00       	and    $0xfff,%eax
  801d6e:	74 1a                	je     801d8a <spawn+0x3fb>
		va -= i;
  801d70:	29 c3                	sub    %eax,%ebx
		memsz += i;
  801d72:	01 c7                	add    %eax,%edi
  801d74:	89 bd 7c fd ff ff    	mov    %edi,-0x284(%ebp)
		filesz += i;
  801d7a:	01 c2                	add    %eax,%edx
  801d7c:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)
		fileoffset -= i;
  801d82:	29 c1                	sub    %eax,%ecx
  801d84:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
	for (i = 0; i < memsz; i += PGSIZE) {
  801d8a:	bf 00 00 00 00       	mov    $0x0,%edi
  801d8f:	89 b5 78 fd ff ff    	mov    %esi,-0x288(%ebp)
  801d95:	e9 01 ff ff ff       	jmp    801c9b <spawn+0x30c>
	close(fd);
  801d9a:	83 ec 0c             	sub    $0xc,%esp
  801d9d:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801da3:	e8 5b f5 ff ff       	call   801303 <close>
  801da8:	83 c4 10             	add    $0x10,%esp
static int
copy_shared_pages(envid_t child)
{
	// LAB 5: Your code here.
	uintptr_t addr;
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801dab:	bb 00 00 00 00       	mov    $0x0,%ebx
  801db0:	8b b5 88 fd ff ff    	mov    -0x278(%ebp),%esi
  801db6:	eb 2b                	jmp    801de3 <spawn+0x454>
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
            sys_page_map(0, (void*)addr, child, (void*)addr, (uvpt[PGNUM(addr)] & PTE_SYSCALL));
  801db8:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801dbf:	83 ec 0c             	sub    $0xc,%esp
  801dc2:	25 07 0e 00 00       	and    $0xe07,%eax
  801dc7:	50                   	push   %eax
  801dc8:	53                   	push   %ebx
  801dc9:	56                   	push   %esi
  801dca:	53                   	push   %ebx
  801dcb:	6a 00                	push   $0x0
  801dcd:	e8 a9 f1 ff ff       	call   800f7b <sys_page_map>
  801dd2:	83 c4 20             	add    $0x20,%esp
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801dd5:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  801ddb:	81 fb 00 00 c0 ee    	cmp    $0xeec00000,%ebx
  801de1:	74 3b                	je     801e1e <spawn+0x48f>
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
  801de3:	89 d8                	mov    %ebx,%eax
  801de5:	c1 e8 16             	shr    $0x16,%eax
  801de8:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801def:	a8 01                	test   $0x1,%al
  801df1:	74 e2                	je     801dd5 <spawn+0x446>
  801df3:	89 d8                	mov    %ebx,%eax
  801df5:	c1 e8 0c             	shr    $0xc,%eax
  801df8:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801dff:	f6 c2 01             	test   $0x1,%dl
  801e02:	74 d1                	je     801dd5 <spawn+0x446>
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
  801e04:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
  801e0b:	f6 c2 04             	test   $0x4,%dl
  801e0e:	74 c5                	je     801dd5 <spawn+0x446>
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
  801e10:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801e17:	f6 c6 04             	test   $0x4,%dh
  801e1a:	74 b9                	je     801dd5 <spawn+0x446>
  801e1c:	eb 9a                	jmp    801db8 <spawn+0x429>
	child_tf.tf_eflags |= FL_IOPL_3;   // devious: see user/faultio.c
  801e1e:	81 8d dc fd ff ff 00 	orl    $0x3000,-0x224(%ebp)
  801e25:	30 00 00 
	if ((r = sys_env_set_trapframe(child, &child_tf)) < 0)
  801e28:	83 ec 08             	sub    $0x8,%esp
  801e2b:	8d 85 a4 fd ff ff    	lea    -0x25c(%ebp),%eax
  801e31:	50                   	push   %eax
  801e32:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801e38:	e8 10 f2 ff ff       	call   80104d <sys_env_set_trapframe>
  801e3d:	83 c4 10             	add    $0x10,%esp
  801e40:	85 c0                	test   %eax,%eax
  801e42:	78 25                	js     801e69 <spawn+0x4da>
	if ((r = sys_env_set_status(child, ENV_RUNNABLE)) < 0)
  801e44:	83 ec 08             	sub    $0x8,%esp
  801e47:	6a 02                	push   $0x2
  801e49:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801e4f:	e8 b3 f1 ff ff       	call   801007 <sys_env_set_status>
  801e54:	83 c4 10             	add    $0x10,%esp
  801e57:	85 c0                	test   %eax,%eax
  801e59:	78 23                	js     801e7e <spawn+0x4ef>
	return child;
  801e5b:	8b 85 74 fd ff ff    	mov    -0x28c(%ebp),%eax
  801e61:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  801e67:	eb 36                	jmp    801e9f <spawn+0x510>
		panic("sys_env_set_trapframe: %e", r);
  801e69:	50                   	push   %eax
  801e6a:	68 ce 2c 80 00       	push   $0x802cce
  801e6f:	68 86 00 00 00       	push   $0x86
  801e74:	68 a5 2c 80 00       	push   $0x802ca5
  801e79:	e8 b4 e5 ff ff       	call   800432 <_panic>
		panic("sys_env_set_status: %e", r);
  801e7e:	50                   	push   %eax
  801e7f:	68 e8 2c 80 00       	push   $0x802ce8
  801e84:	68 89 00 00 00       	push   $0x89
  801e89:	68 a5 2c 80 00       	push   $0x802ca5
  801e8e:	e8 9f e5 ff ff       	call   800432 <_panic>
		return r;
  801e93:	8b 85 74 fd ff ff    	mov    -0x28c(%ebp),%eax
  801e99:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
}
  801e9f:	8b 85 94 fd ff ff    	mov    -0x26c(%ebp),%eax
  801ea5:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801ea8:	5b                   	pop    %ebx
  801ea9:	5e                   	pop    %esi
  801eaa:	5f                   	pop    %edi
  801eab:	5d                   	pop    %ebp
  801eac:	c3                   	ret    
  801ead:	89 c7                	mov    %eax,%edi
  801eaf:	e9 1b fe ff ff       	jmp    801ccf <spawn+0x340>
  801eb4:	89 c7                	mov    %eax,%edi
  801eb6:	e9 14 fe ff ff       	jmp    801ccf <spawn+0x340>
  801ebb:	89 c7                	mov    %eax,%edi
  801ebd:	e9 0d fe ff ff       	jmp    801ccf <spawn+0x340>
		return -E_NO_MEM;
  801ec2:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801ec7:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  801ecd:	eb d0                	jmp    801e9f <spawn+0x510>
	sys_page_unmap(0, UTEMP);
  801ecf:	83 ec 08             	sub    $0x8,%esp
  801ed2:	68 00 00 40 00       	push   $0x400000
  801ed7:	6a 00                	push   $0x0
  801ed9:	e8 e3 f0 ff ff       	call   800fc1 <sys_page_unmap>
  801ede:	83 c4 10             	add    $0x10,%esp
  801ee1:	89 9d 94 fd ff ff    	mov    %ebx,-0x26c(%ebp)
  801ee7:	eb b6                	jmp    801e9f <spawn+0x510>

00801ee9 <spawnl>:
{
  801ee9:	f3 0f 1e fb          	endbr32 
  801eed:	55                   	push   %ebp
  801eee:	89 e5                	mov    %esp,%ebp
  801ef0:	57                   	push   %edi
  801ef1:	56                   	push   %esi
  801ef2:	53                   	push   %ebx
  801ef3:	83 ec 0c             	sub    $0xc,%esp
	va_start(vl, arg0);
  801ef6:	8d 55 10             	lea    0x10(%ebp),%edx
	int argc=0;
  801ef9:	b8 00 00 00 00       	mov    $0x0,%eax
	while(va_arg(vl, void *) != NULL)
  801efe:	8d 4a 04             	lea    0x4(%edx),%ecx
  801f01:	83 3a 00             	cmpl   $0x0,(%edx)
  801f04:	74 07                	je     801f0d <spawnl+0x24>
		argc++;
  801f06:	83 c0 01             	add    $0x1,%eax
	while(va_arg(vl, void *) != NULL)
  801f09:	89 ca                	mov    %ecx,%edx
  801f0b:	eb f1                	jmp    801efe <spawnl+0x15>
	const char *argv[argc+2];
  801f0d:	8d 14 85 17 00 00 00 	lea    0x17(,%eax,4),%edx
  801f14:	89 d1                	mov    %edx,%ecx
  801f16:	83 e1 f0             	and    $0xfffffff0,%ecx
  801f19:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
  801f1f:	89 e6                	mov    %esp,%esi
  801f21:	29 d6                	sub    %edx,%esi
  801f23:	89 f2                	mov    %esi,%edx
  801f25:	39 d4                	cmp    %edx,%esp
  801f27:	74 10                	je     801f39 <spawnl+0x50>
  801f29:	81 ec 00 10 00 00    	sub    $0x1000,%esp
  801f2f:	83 8c 24 fc 0f 00 00 	orl    $0x0,0xffc(%esp)
  801f36:	00 
  801f37:	eb ec                	jmp    801f25 <spawnl+0x3c>
  801f39:	89 ca                	mov    %ecx,%edx
  801f3b:	81 e2 ff 0f 00 00    	and    $0xfff,%edx
  801f41:	29 d4                	sub    %edx,%esp
  801f43:	85 d2                	test   %edx,%edx
  801f45:	74 05                	je     801f4c <spawnl+0x63>
  801f47:	83 4c 14 fc 00       	orl    $0x0,-0x4(%esp,%edx,1)
  801f4c:	8d 74 24 03          	lea    0x3(%esp),%esi
  801f50:	89 f2                	mov    %esi,%edx
  801f52:	c1 ea 02             	shr    $0x2,%edx
  801f55:	83 e6 fc             	and    $0xfffffffc,%esi
  801f58:	89 f3                	mov    %esi,%ebx
	argv[0] = arg0;
  801f5a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801f5d:	89 0c 95 00 00 00 00 	mov    %ecx,0x0(,%edx,4)
	argv[argc+1] = NULL;
  801f64:	c7 44 86 04 00 00 00 	movl   $0x0,0x4(%esi,%eax,4)
  801f6b:	00 
	va_start(vl, arg0);
  801f6c:	8d 4d 10             	lea    0x10(%ebp),%ecx
  801f6f:	89 c2                	mov    %eax,%edx
	for(i=0;i<argc;i++)
  801f71:	b8 00 00 00 00       	mov    $0x0,%eax
  801f76:	eb 0b                	jmp    801f83 <spawnl+0x9a>
		argv[i+1] = va_arg(vl, const char *);
  801f78:	83 c0 01             	add    $0x1,%eax
  801f7b:	8b 39                	mov    (%ecx),%edi
  801f7d:	89 3c 83             	mov    %edi,(%ebx,%eax,4)
  801f80:	8d 49 04             	lea    0x4(%ecx),%ecx
	for(i=0;i<argc;i++)
  801f83:	39 d0                	cmp    %edx,%eax
  801f85:	75 f1                	jne    801f78 <spawnl+0x8f>
	return spawn(prog, argv);
  801f87:	83 ec 08             	sub    $0x8,%esp
  801f8a:	56                   	push   %esi
  801f8b:	ff 75 08             	pushl  0x8(%ebp)
  801f8e:	e8 fc f9 ff ff       	call   80198f <spawn>
}
  801f93:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801f96:	5b                   	pop    %ebx
  801f97:	5e                   	pop    %esi
  801f98:	5f                   	pop    %edi
  801f99:	5d                   	pop    %ebp
  801f9a:	c3                   	ret    

00801f9b <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801f9b:	f3 0f 1e fb          	endbr32 
  801f9f:	55                   	push   %ebp
  801fa0:	89 e5                	mov    %esp,%ebp
  801fa2:	56                   	push   %esi
  801fa3:	53                   	push   %ebx
  801fa4:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801fa7:	83 ec 0c             	sub    $0xc,%esp
  801faa:	ff 75 08             	pushl  0x8(%ebp)
  801fad:	e8 a7 f1 ff ff       	call   801159 <fd2data>
  801fb2:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801fb4:	83 c4 08             	add    $0x8,%esp
  801fb7:	68 26 2d 80 00       	push   $0x802d26
  801fbc:	53                   	push   %ebx
  801fbd:	e8 30 eb ff ff       	call   800af2 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801fc2:	8b 46 04             	mov    0x4(%esi),%eax
  801fc5:	2b 06                	sub    (%esi),%eax
  801fc7:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801fcd:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801fd4:	00 00 00 
	stat->st_dev = &devpipe;
  801fd7:	c7 83 88 00 00 00 ac 	movl   $0x8047ac,0x88(%ebx)
  801fde:	47 80 00 
	return 0;
}
  801fe1:	b8 00 00 00 00       	mov    $0x0,%eax
  801fe6:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801fe9:	5b                   	pop    %ebx
  801fea:	5e                   	pop    %esi
  801feb:	5d                   	pop    %ebp
  801fec:	c3                   	ret    

00801fed <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801fed:	f3 0f 1e fb          	endbr32 
  801ff1:	55                   	push   %ebp
  801ff2:	89 e5                	mov    %esp,%ebp
  801ff4:	53                   	push   %ebx
  801ff5:	83 ec 0c             	sub    $0xc,%esp
  801ff8:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801ffb:	53                   	push   %ebx
  801ffc:	6a 00                	push   $0x0
  801ffe:	e8 be ef ff ff       	call   800fc1 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  802003:	89 1c 24             	mov    %ebx,(%esp)
  802006:	e8 4e f1 ff ff       	call   801159 <fd2data>
  80200b:	83 c4 08             	add    $0x8,%esp
  80200e:	50                   	push   %eax
  80200f:	6a 00                	push   $0x0
  802011:	e8 ab ef ff ff       	call   800fc1 <sys_page_unmap>
}
  802016:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  802019:	c9                   	leave  
  80201a:	c3                   	ret    

0080201b <_pipeisclosed>:
{
  80201b:	55                   	push   %ebp
  80201c:	89 e5                	mov    %esp,%ebp
  80201e:	57                   	push   %edi
  80201f:	56                   	push   %esi
  802020:	53                   	push   %ebx
  802021:	83 ec 1c             	sub    $0x1c,%esp
  802024:	89 c7                	mov    %eax,%edi
  802026:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  802028:	a1 90 67 80 00       	mov    0x806790,%eax
  80202d:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  802030:	83 ec 0c             	sub    $0xc,%esp
  802033:	57                   	push   %edi
  802034:	e8 31 04 00 00       	call   80246a <pageref>
  802039:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80203c:	89 34 24             	mov    %esi,(%esp)
  80203f:	e8 26 04 00 00       	call   80246a <pageref>
		nn = thisenv->env_runs;
  802044:	8b 15 90 67 80 00    	mov    0x806790,%edx
  80204a:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  80204d:	83 c4 10             	add    $0x10,%esp
  802050:	39 cb                	cmp    %ecx,%ebx
  802052:	74 1b                	je     80206f <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  802054:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  802057:	75 cf                	jne    802028 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  802059:	8b 42 58             	mov    0x58(%edx),%eax
  80205c:	6a 01                	push   $0x1
  80205e:	50                   	push   %eax
  80205f:	53                   	push   %ebx
  802060:	68 2d 2d 80 00       	push   $0x802d2d
  802065:	e8 af e4 ff ff       	call   800519 <cprintf>
  80206a:	83 c4 10             	add    $0x10,%esp
  80206d:	eb b9                	jmp    802028 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  80206f:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  802072:	0f 94 c0             	sete   %al
  802075:	0f b6 c0             	movzbl %al,%eax
}
  802078:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80207b:	5b                   	pop    %ebx
  80207c:	5e                   	pop    %esi
  80207d:	5f                   	pop    %edi
  80207e:	5d                   	pop    %ebp
  80207f:	c3                   	ret    

00802080 <devpipe_write>:
{
  802080:	f3 0f 1e fb          	endbr32 
  802084:	55                   	push   %ebp
  802085:	89 e5                	mov    %esp,%ebp
  802087:	57                   	push   %edi
  802088:	56                   	push   %esi
  802089:	53                   	push   %ebx
  80208a:	83 ec 28             	sub    $0x28,%esp
  80208d:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  802090:	56                   	push   %esi
  802091:	e8 c3 f0 ff ff       	call   801159 <fd2data>
  802096:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  802098:	83 c4 10             	add    $0x10,%esp
  80209b:	bf 00 00 00 00       	mov    $0x0,%edi
  8020a0:	3b 7d 10             	cmp    0x10(%ebp),%edi
  8020a3:	74 4f                	je     8020f4 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8020a5:	8b 43 04             	mov    0x4(%ebx),%eax
  8020a8:	8b 0b                	mov    (%ebx),%ecx
  8020aa:	8d 51 20             	lea    0x20(%ecx),%edx
  8020ad:	39 d0                	cmp    %edx,%eax
  8020af:	72 14                	jb     8020c5 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  8020b1:	89 da                	mov    %ebx,%edx
  8020b3:	89 f0                	mov    %esi,%eax
  8020b5:	e8 61 ff ff ff       	call   80201b <_pipeisclosed>
  8020ba:	85 c0                	test   %eax,%eax
  8020bc:	75 3b                	jne    8020f9 <devpipe_write+0x79>
			sys_yield();
  8020be:	e8 4e ee ff ff       	call   800f11 <sys_yield>
  8020c3:	eb e0                	jmp    8020a5 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  8020c5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8020c8:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  8020cc:	88 4d e7             	mov    %cl,-0x19(%ebp)
  8020cf:	89 c2                	mov    %eax,%edx
  8020d1:	c1 fa 1f             	sar    $0x1f,%edx
  8020d4:	89 d1                	mov    %edx,%ecx
  8020d6:	c1 e9 1b             	shr    $0x1b,%ecx
  8020d9:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  8020dc:	83 e2 1f             	and    $0x1f,%edx
  8020df:	29 ca                	sub    %ecx,%edx
  8020e1:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  8020e5:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  8020e9:	83 c0 01             	add    $0x1,%eax
  8020ec:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  8020ef:	83 c7 01             	add    $0x1,%edi
  8020f2:	eb ac                	jmp    8020a0 <devpipe_write+0x20>
	return i;
  8020f4:	8b 45 10             	mov    0x10(%ebp),%eax
  8020f7:	eb 05                	jmp    8020fe <devpipe_write+0x7e>
				return 0;
  8020f9:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8020fe:	8d 65 f4             	lea    -0xc(%ebp),%esp
  802101:	5b                   	pop    %ebx
  802102:	5e                   	pop    %esi
  802103:	5f                   	pop    %edi
  802104:	5d                   	pop    %ebp
  802105:	c3                   	ret    

00802106 <devpipe_read>:
{
  802106:	f3 0f 1e fb          	endbr32 
  80210a:	55                   	push   %ebp
  80210b:	89 e5                	mov    %esp,%ebp
  80210d:	57                   	push   %edi
  80210e:	56                   	push   %esi
  80210f:	53                   	push   %ebx
  802110:	83 ec 18             	sub    $0x18,%esp
  802113:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  802116:	57                   	push   %edi
  802117:	e8 3d f0 ff ff       	call   801159 <fd2data>
  80211c:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80211e:	83 c4 10             	add    $0x10,%esp
  802121:	be 00 00 00 00       	mov    $0x0,%esi
  802126:	3b 75 10             	cmp    0x10(%ebp),%esi
  802129:	75 14                	jne    80213f <devpipe_read+0x39>
	return i;
  80212b:	8b 45 10             	mov    0x10(%ebp),%eax
  80212e:	eb 02                	jmp    802132 <devpipe_read+0x2c>
				return i;
  802130:	89 f0                	mov    %esi,%eax
}
  802132:	8d 65 f4             	lea    -0xc(%ebp),%esp
  802135:	5b                   	pop    %ebx
  802136:	5e                   	pop    %esi
  802137:	5f                   	pop    %edi
  802138:	5d                   	pop    %ebp
  802139:	c3                   	ret    
			sys_yield();
  80213a:	e8 d2 ed ff ff       	call   800f11 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  80213f:	8b 03                	mov    (%ebx),%eax
  802141:	3b 43 04             	cmp    0x4(%ebx),%eax
  802144:	75 18                	jne    80215e <devpipe_read+0x58>
			if (i > 0)
  802146:	85 f6                	test   %esi,%esi
  802148:	75 e6                	jne    802130 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  80214a:	89 da                	mov    %ebx,%edx
  80214c:	89 f8                	mov    %edi,%eax
  80214e:	e8 c8 fe ff ff       	call   80201b <_pipeisclosed>
  802153:	85 c0                	test   %eax,%eax
  802155:	74 e3                	je     80213a <devpipe_read+0x34>
				return 0;
  802157:	b8 00 00 00 00       	mov    $0x0,%eax
  80215c:	eb d4                	jmp    802132 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  80215e:	99                   	cltd   
  80215f:	c1 ea 1b             	shr    $0x1b,%edx
  802162:	01 d0                	add    %edx,%eax
  802164:	83 e0 1f             	and    $0x1f,%eax
  802167:	29 d0                	sub    %edx,%eax
  802169:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  80216e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  802171:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  802174:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  802177:	83 c6 01             	add    $0x1,%esi
  80217a:	eb aa                	jmp    802126 <devpipe_read+0x20>

0080217c <pipe>:
{
  80217c:	f3 0f 1e fb          	endbr32 
  802180:	55                   	push   %ebp
  802181:	89 e5                	mov    %esp,%ebp
  802183:	56                   	push   %esi
  802184:	53                   	push   %ebx
  802185:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  802188:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80218b:	50                   	push   %eax
  80218c:	e8 e3 ef ff ff       	call   801174 <fd_alloc>
  802191:	89 c3                	mov    %eax,%ebx
  802193:	83 c4 10             	add    $0x10,%esp
  802196:	85 c0                	test   %eax,%eax
  802198:	0f 88 23 01 00 00    	js     8022c1 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80219e:	83 ec 04             	sub    $0x4,%esp
  8021a1:	68 07 04 00 00       	push   $0x407
  8021a6:	ff 75 f4             	pushl  -0xc(%ebp)
  8021a9:	6a 00                	push   $0x0
  8021ab:	e8 84 ed ff ff       	call   800f34 <sys_page_alloc>
  8021b0:	89 c3                	mov    %eax,%ebx
  8021b2:	83 c4 10             	add    $0x10,%esp
  8021b5:	85 c0                	test   %eax,%eax
  8021b7:	0f 88 04 01 00 00    	js     8022c1 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  8021bd:	83 ec 0c             	sub    $0xc,%esp
  8021c0:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8021c3:	50                   	push   %eax
  8021c4:	e8 ab ef ff ff       	call   801174 <fd_alloc>
  8021c9:	89 c3                	mov    %eax,%ebx
  8021cb:	83 c4 10             	add    $0x10,%esp
  8021ce:	85 c0                	test   %eax,%eax
  8021d0:	0f 88 db 00 00 00    	js     8022b1 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8021d6:	83 ec 04             	sub    $0x4,%esp
  8021d9:	68 07 04 00 00       	push   $0x407
  8021de:	ff 75 f0             	pushl  -0x10(%ebp)
  8021e1:	6a 00                	push   $0x0
  8021e3:	e8 4c ed ff ff       	call   800f34 <sys_page_alloc>
  8021e8:	89 c3                	mov    %eax,%ebx
  8021ea:	83 c4 10             	add    $0x10,%esp
  8021ed:	85 c0                	test   %eax,%eax
  8021ef:	0f 88 bc 00 00 00    	js     8022b1 <pipe+0x135>
	va = fd2data(fd0);
  8021f5:	83 ec 0c             	sub    $0xc,%esp
  8021f8:	ff 75 f4             	pushl  -0xc(%ebp)
  8021fb:	e8 59 ef ff ff       	call   801159 <fd2data>
  802200:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  802202:	83 c4 0c             	add    $0xc,%esp
  802205:	68 07 04 00 00       	push   $0x407
  80220a:	50                   	push   %eax
  80220b:	6a 00                	push   $0x0
  80220d:	e8 22 ed ff ff       	call   800f34 <sys_page_alloc>
  802212:	89 c3                	mov    %eax,%ebx
  802214:	83 c4 10             	add    $0x10,%esp
  802217:	85 c0                	test   %eax,%eax
  802219:	0f 88 82 00 00 00    	js     8022a1 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80221f:	83 ec 0c             	sub    $0xc,%esp
  802222:	ff 75 f0             	pushl  -0x10(%ebp)
  802225:	e8 2f ef ff ff       	call   801159 <fd2data>
  80222a:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  802231:	50                   	push   %eax
  802232:	6a 00                	push   $0x0
  802234:	56                   	push   %esi
  802235:	6a 00                	push   $0x0
  802237:	e8 3f ed ff ff       	call   800f7b <sys_page_map>
  80223c:	89 c3                	mov    %eax,%ebx
  80223e:	83 c4 20             	add    $0x20,%esp
  802241:	85 c0                	test   %eax,%eax
  802243:	78 4e                	js     802293 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  802245:	a1 ac 47 80 00       	mov    0x8047ac,%eax
  80224a:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80224d:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  80224f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  802252:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  802259:	8b 55 f0             	mov    -0x10(%ebp),%edx
  80225c:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  80225e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  802261:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  802268:	83 ec 0c             	sub    $0xc,%esp
  80226b:	ff 75 f4             	pushl  -0xc(%ebp)
  80226e:	e8 d2 ee ff ff       	call   801145 <fd2num>
  802273:	8b 4d 08             	mov    0x8(%ebp),%ecx
  802276:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  802278:	83 c4 04             	add    $0x4,%esp
  80227b:	ff 75 f0             	pushl  -0x10(%ebp)
  80227e:	e8 c2 ee ff ff       	call   801145 <fd2num>
  802283:	8b 4d 08             	mov    0x8(%ebp),%ecx
  802286:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  802289:	83 c4 10             	add    $0x10,%esp
  80228c:	bb 00 00 00 00       	mov    $0x0,%ebx
  802291:	eb 2e                	jmp    8022c1 <pipe+0x145>
	sys_page_unmap(0, va);
  802293:	83 ec 08             	sub    $0x8,%esp
  802296:	56                   	push   %esi
  802297:	6a 00                	push   $0x0
  802299:	e8 23 ed ff ff       	call   800fc1 <sys_page_unmap>
  80229e:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8022a1:	83 ec 08             	sub    $0x8,%esp
  8022a4:	ff 75 f0             	pushl  -0x10(%ebp)
  8022a7:	6a 00                	push   $0x0
  8022a9:	e8 13 ed ff ff       	call   800fc1 <sys_page_unmap>
  8022ae:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  8022b1:	83 ec 08             	sub    $0x8,%esp
  8022b4:	ff 75 f4             	pushl  -0xc(%ebp)
  8022b7:	6a 00                	push   $0x0
  8022b9:	e8 03 ed ff ff       	call   800fc1 <sys_page_unmap>
  8022be:	83 c4 10             	add    $0x10,%esp
}
  8022c1:	89 d8                	mov    %ebx,%eax
  8022c3:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8022c6:	5b                   	pop    %ebx
  8022c7:	5e                   	pop    %esi
  8022c8:	5d                   	pop    %ebp
  8022c9:	c3                   	ret    

008022ca <pipeisclosed>:
{
  8022ca:	f3 0f 1e fb          	endbr32 
  8022ce:	55                   	push   %ebp
  8022cf:	89 e5                	mov    %esp,%ebp
  8022d1:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8022d4:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8022d7:	50                   	push   %eax
  8022d8:	ff 75 08             	pushl  0x8(%ebp)
  8022db:	e8 ea ee ff ff       	call   8011ca <fd_lookup>
  8022e0:	83 c4 10             	add    $0x10,%esp
  8022e3:	85 c0                	test   %eax,%eax
  8022e5:	78 18                	js     8022ff <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  8022e7:	83 ec 0c             	sub    $0xc,%esp
  8022ea:	ff 75 f4             	pushl  -0xc(%ebp)
  8022ed:	e8 67 ee ff ff       	call   801159 <fd2data>
  8022f2:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  8022f4:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8022f7:	e8 1f fd ff ff       	call   80201b <_pipeisclosed>
  8022fc:	83 c4 10             	add    $0x10,%esp
}
  8022ff:	c9                   	leave  
  802300:	c3                   	ret    

00802301 <wait>:
#include <inc/lib.h>

// Waits until 'envid' exits.
void
wait(envid_t envid)
{
  802301:	f3 0f 1e fb          	endbr32 
  802305:	55                   	push   %ebp
  802306:	89 e5                	mov    %esp,%ebp
  802308:	56                   	push   %esi
  802309:	53                   	push   %ebx
  80230a:	8b 75 08             	mov    0x8(%ebp),%esi
	const volatile struct Env *e;

	assert(envid != 0);
  80230d:	85 f6                	test   %esi,%esi
  80230f:	74 13                	je     802324 <wait+0x23>
	e = &envs[ENVX(envid)];
  802311:	89 f3                	mov    %esi,%ebx
  802313:	81 e3 ff 03 00 00    	and    $0x3ff,%ebx
	while (e->env_id == envid && e->env_status != ENV_FREE)
  802319:	6b db 7c             	imul   $0x7c,%ebx,%ebx
  80231c:	81 c3 00 00 c0 ee    	add    $0xeec00000,%ebx
  802322:	eb 1b                	jmp    80233f <wait+0x3e>
	assert(envid != 0);
  802324:	68 45 2d 80 00       	push   $0x802d45
  802329:	68 5f 2c 80 00       	push   $0x802c5f
  80232e:	6a 09                	push   $0x9
  802330:	68 50 2d 80 00       	push   $0x802d50
  802335:	e8 f8 e0 ff ff       	call   800432 <_panic>
		sys_yield();
  80233a:	e8 d2 eb ff ff       	call   800f11 <sys_yield>
	while (e->env_id == envid && e->env_status != ENV_FREE)
  80233f:	8b 43 48             	mov    0x48(%ebx),%eax
  802342:	39 f0                	cmp    %esi,%eax
  802344:	75 07                	jne    80234d <wait+0x4c>
  802346:	8b 43 54             	mov    0x54(%ebx),%eax
  802349:	85 c0                	test   %eax,%eax
  80234b:	75 ed                	jne    80233a <wait+0x39>
}
  80234d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  802350:	5b                   	pop    %ebx
  802351:	5e                   	pop    %esi
  802352:	5d                   	pop    %ebp
  802353:	c3                   	ret    

00802354 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  802354:	f3 0f 1e fb          	endbr32 
  802358:	55                   	push   %ebp
  802359:	89 e5                	mov    %esp,%ebp
  80235b:	56                   	push   %esi
  80235c:	53                   	push   %ebx
  80235d:	8b 75 08             	mov    0x8(%ebp),%esi
  802360:	8b 45 0c             	mov    0xc(%ebp),%eax
  802363:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  802366:	85 c0                	test   %eax,%eax
  802368:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  80236d:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  802370:	83 ec 0c             	sub    $0xc,%esp
  802373:	50                   	push   %eax
  802374:	e8 87 ed ff ff       	call   801100 <sys_ipc_recv>
  802379:	83 c4 10             	add    $0x10,%esp
  80237c:	85 c0                	test   %eax,%eax
  80237e:	78 3f                	js     8023bf <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  802380:	e8 69 eb ff ff       	call   800eee <sys_getenvid>
  802385:	25 ff 03 00 00       	and    $0x3ff,%eax
  80238a:	6b d0 7c             	imul   $0x7c,%eax,%edx
  80238d:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  802393:	89 15 90 67 80 00    	mov    %edx,0x806790

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  802399:	85 f6                	test   %esi,%esi
  80239b:	74 05                	je     8023a2 <ipc_recv+0x4e>
  80239d:	8b 42 74             	mov    0x74(%edx),%eax
  8023a0:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  8023a2:	85 db                	test   %ebx,%ebx
  8023a4:	74 0a                	je     8023b0 <ipc_recv+0x5c>
  8023a6:	a1 90 67 80 00       	mov    0x806790,%eax
  8023ab:	8b 40 78             	mov    0x78(%eax),%eax
  8023ae:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  8023b0:	a1 90 67 80 00       	mov    0x806790,%eax
  8023b5:	8b 40 70             	mov    0x70(%eax),%eax
}
  8023b8:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8023bb:	5b                   	pop    %ebx
  8023bc:	5e                   	pop    %esi
  8023bd:	5d                   	pop    %ebp
  8023be:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  8023bf:	85 f6                	test   %esi,%esi
  8023c1:	74 06                	je     8023c9 <ipc_recv+0x75>
  8023c3:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  8023c9:	85 db                	test   %ebx,%ebx
  8023cb:	74 eb                	je     8023b8 <ipc_recv+0x64>
  8023cd:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8023d3:	eb e3                	jmp    8023b8 <ipc_recv+0x64>

008023d5 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  8023d5:	f3 0f 1e fb          	endbr32 
  8023d9:	55                   	push   %ebp
  8023da:	89 e5                	mov    %esp,%ebp
  8023dc:	57                   	push   %edi
  8023dd:	56                   	push   %esi
  8023de:	53                   	push   %ebx
  8023df:	83 ec 0c             	sub    $0xc,%esp
  8023e2:	8b 7d 08             	mov    0x8(%ebp),%edi
  8023e5:	8b 75 0c             	mov    0xc(%ebp),%esi
  8023e8:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  8023eb:	85 db                	test   %ebx,%ebx
  8023ed:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  8023f2:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  8023f5:	ff 75 14             	pushl  0x14(%ebp)
  8023f8:	53                   	push   %ebx
  8023f9:	56                   	push   %esi
  8023fa:	57                   	push   %edi
  8023fb:	e8 d9 ec ff ff       	call   8010d9 <sys_ipc_try_send>
  802400:	83 c4 10             	add    $0x10,%esp
  802403:	85 c0                	test   %eax,%eax
  802405:	79 1e                	jns    802425 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  802407:	83 f8 f9             	cmp    $0xfffffff9,%eax
  80240a:	75 07                	jne    802413 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  80240c:	e8 00 eb ff ff       	call   800f11 <sys_yield>
  802411:	eb e2                	jmp    8023f5 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  802413:	50                   	push   %eax
  802414:	68 5b 2d 80 00       	push   $0x802d5b
  802419:	6a 3b                	push   $0x3b
  80241b:	68 6f 2d 80 00       	push   $0x802d6f
  802420:	e8 0d e0 ff ff       	call   800432 <_panic>
	}
}
  802425:	8d 65 f4             	lea    -0xc(%ebp),%esp
  802428:	5b                   	pop    %ebx
  802429:	5e                   	pop    %esi
  80242a:	5f                   	pop    %edi
  80242b:	5d                   	pop    %ebp
  80242c:	c3                   	ret    

0080242d <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  80242d:	f3 0f 1e fb          	endbr32 
  802431:	55                   	push   %ebp
  802432:	89 e5                	mov    %esp,%ebp
  802434:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  802437:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  80243c:	6b d0 7c             	imul   $0x7c,%eax,%edx
  80243f:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  802445:	8b 52 50             	mov    0x50(%edx),%edx
  802448:	39 ca                	cmp    %ecx,%edx
  80244a:	74 11                	je     80245d <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  80244c:	83 c0 01             	add    $0x1,%eax
  80244f:	3d 00 04 00 00       	cmp    $0x400,%eax
  802454:	75 e6                	jne    80243c <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  802456:	b8 00 00 00 00       	mov    $0x0,%eax
  80245b:	eb 0b                	jmp    802468 <ipc_find_env+0x3b>
			return envs[i].env_id;
  80245d:	6b c0 7c             	imul   $0x7c,%eax,%eax
  802460:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  802465:	8b 40 48             	mov    0x48(%eax),%eax
}
  802468:	5d                   	pop    %ebp
  802469:	c3                   	ret    

0080246a <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  80246a:	f3 0f 1e fb          	endbr32 
  80246e:	55                   	push   %ebp
  80246f:	89 e5                	mov    %esp,%ebp
  802471:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  802474:	89 c2                	mov    %eax,%edx
  802476:	c1 ea 16             	shr    $0x16,%edx
  802479:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  802480:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  802485:	f6 c1 01             	test   $0x1,%cl
  802488:	74 1c                	je     8024a6 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  80248a:	c1 e8 0c             	shr    $0xc,%eax
  80248d:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  802494:	a8 01                	test   $0x1,%al
  802496:	74 0e                	je     8024a6 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  802498:	c1 e8 0c             	shr    $0xc,%eax
  80249b:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  8024a2:	ef 
  8024a3:	0f b7 d2             	movzwl %dx,%edx
}
  8024a6:	89 d0                	mov    %edx,%eax
  8024a8:	5d                   	pop    %ebp
  8024a9:	c3                   	ret    
  8024aa:	66 90                	xchg   %ax,%ax
  8024ac:	66 90                	xchg   %ax,%ax
  8024ae:	66 90                	xchg   %ax,%ax

008024b0 <__udivdi3>:
  8024b0:	f3 0f 1e fb          	endbr32 
  8024b4:	55                   	push   %ebp
  8024b5:	57                   	push   %edi
  8024b6:	56                   	push   %esi
  8024b7:	53                   	push   %ebx
  8024b8:	83 ec 1c             	sub    $0x1c,%esp
  8024bb:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  8024bf:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  8024c3:	8b 74 24 34          	mov    0x34(%esp),%esi
  8024c7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  8024cb:	85 d2                	test   %edx,%edx
  8024cd:	75 19                	jne    8024e8 <__udivdi3+0x38>
  8024cf:	39 f3                	cmp    %esi,%ebx
  8024d1:	76 4d                	jbe    802520 <__udivdi3+0x70>
  8024d3:	31 ff                	xor    %edi,%edi
  8024d5:	89 e8                	mov    %ebp,%eax
  8024d7:	89 f2                	mov    %esi,%edx
  8024d9:	f7 f3                	div    %ebx
  8024db:	89 fa                	mov    %edi,%edx
  8024dd:	83 c4 1c             	add    $0x1c,%esp
  8024e0:	5b                   	pop    %ebx
  8024e1:	5e                   	pop    %esi
  8024e2:	5f                   	pop    %edi
  8024e3:	5d                   	pop    %ebp
  8024e4:	c3                   	ret    
  8024e5:	8d 76 00             	lea    0x0(%esi),%esi
  8024e8:	39 f2                	cmp    %esi,%edx
  8024ea:	76 14                	jbe    802500 <__udivdi3+0x50>
  8024ec:	31 ff                	xor    %edi,%edi
  8024ee:	31 c0                	xor    %eax,%eax
  8024f0:	89 fa                	mov    %edi,%edx
  8024f2:	83 c4 1c             	add    $0x1c,%esp
  8024f5:	5b                   	pop    %ebx
  8024f6:	5e                   	pop    %esi
  8024f7:	5f                   	pop    %edi
  8024f8:	5d                   	pop    %ebp
  8024f9:	c3                   	ret    
  8024fa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  802500:	0f bd fa             	bsr    %edx,%edi
  802503:	83 f7 1f             	xor    $0x1f,%edi
  802506:	75 48                	jne    802550 <__udivdi3+0xa0>
  802508:	39 f2                	cmp    %esi,%edx
  80250a:	72 06                	jb     802512 <__udivdi3+0x62>
  80250c:	31 c0                	xor    %eax,%eax
  80250e:	39 eb                	cmp    %ebp,%ebx
  802510:	77 de                	ja     8024f0 <__udivdi3+0x40>
  802512:	b8 01 00 00 00       	mov    $0x1,%eax
  802517:	eb d7                	jmp    8024f0 <__udivdi3+0x40>
  802519:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802520:	89 d9                	mov    %ebx,%ecx
  802522:	85 db                	test   %ebx,%ebx
  802524:	75 0b                	jne    802531 <__udivdi3+0x81>
  802526:	b8 01 00 00 00       	mov    $0x1,%eax
  80252b:	31 d2                	xor    %edx,%edx
  80252d:	f7 f3                	div    %ebx
  80252f:	89 c1                	mov    %eax,%ecx
  802531:	31 d2                	xor    %edx,%edx
  802533:	89 f0                	mov    %esi,%eax
  802535:	f7 f1                	div    %ecx
  802537:	89 c6                	mov    %eax,%esi
  802539:	89 e8                	mov    %ebp,%eax
  80253b:	89 f7                	mov    %esi,%edi
  80253d:	f7 f1                	div    %ecx
  80253f:	89 fa                	mov    %edi,%edx
  802541:	83 c4 1c             	add    $0x1c,%esp
  802544:	5b                   	pop    %ebx
  802545:	5e                   	pop    %esi
  802546:	5f                   	pop    %edi
  802547:	5d                   	pop    %ebp
  802548:	c3                   	ret    
  802549:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802550:	89 f9                	mov    %edi,%ecx
  802552:	b8 20 00 00 00       	mov    $0x20,%eax
  802557:	29 f8                	sub    %edi,%eax
  802559:	d3 e2                	shl    %cl,%edx
  80255b:	89 54 24 08          	mov    %edx,0x8(%esp)
  80255f:	89 c1                	mov    %eax,%ecx
  802561:	89 da                	mov    %ebx,%edx
  802563:	d3 ea                	shr    %cl,%edx
  802565:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802569:	09 d1                	or     %edx,%ecx
  80256b:	89 f2                	mov    %esi,%edx
  80256d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802571:	89 f9                	mov    %edi,%ecx
  802573:	d3 e3                	shl    %cl,%ebx
  802575:	89 c1                	mov    %eax,%ecx
  802577:	d3 ea                	shr    %cl,%edx
  802579:	89 f9                	mov    %edi,%ecx
  80257b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  80257f:	89 eb                	mov    %ebp,%ebx
  802581:	d3 e6                	shl    %cl,%esi
  802583:	89 c1                	mov    %eax,%ecx
  802585:	d3 eb                	shr    %cl,%ebx
  802587:	09 de                	or     %ebx,%esi
  802589:	89 f0                	mov    %esi,%eax
  80258b:	f7 74 24 08          	divl   0x8(%esp)
  80258f:	89 d6                	mov    %edx,%esi
  802591:	89 c3                	mov    %eax,%ebx
  802593:	f7 64 24 0c          	mull   0xc(%esp)
  802597:	39 d6                	cmp    %edx,%esi
  802599:	72 15                	jb     8025b0 <__udivdi3+0x100>
  80259b:	89 f9                	mov    %edi,%ecx
  80259d:	d3 e5                	shl    %cl,%ebp
  80259f:	39 c5                	cmp    %eax,%ebp
  8025a1:	73 04                	jae    8025a7 <__udivdi3+0xf7>
  8025a3:	39 d6                	cmp    %edx,%esi
  8025a5:	74 09                	je     8025b0 <__udivdi3+0x100>
  8025a7:	89 d8                	mov    %ebx,%eax
  8025a9:	31 ff                	xor    %edi,%edi
  8025ab:	e9 40 ff ff ff       	jmp    8024f0 <__udivdi3+0x40>
  8025b0:	8d 43 ff             	lea    -0x1(%ebx),%eax
  8025b3:	31 ff                	xor    %edi,%edi
  8025b5:	e9 36 ff ff ff       	jmp    8024f0 <__udivdi3+0x40>
  8025ba:	66 90                	xchg   %ax,%ax
  8025bc:	66 90                	xchg   %ax,%ax
  8025be:	66 90                	xchg   %ax,%ax

008025c0 <__umoddi3>:
  8025c0:	f3 0f 1e fb          	endbr32 
  8025c4:	55                   	push   %ebp
  8025c5:	57                   	push   %edi
  8025c6:	56                   	push   %esi
  8025c7:	53                   	push   %ebx
  8025c8:	83 ec 1c             	sub    $0x1c,%esp
  8025cb:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  8025cf:	8b 74 24 30          	mov    0x30(%esp),%esi
  8025d3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  8025d7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  8025db:	85 c0                	test   %eax,%eax
  8025dd:	75 19                	jne    8025f8 <__umoddi3+0x38>
  8025df:	39 df                	cmp    %ebx,%edi
  8025e1:	76 5d                	jbe    802640 <__umoddi3+0x80>
  8025e3:	89 f0                	mov    %esi,%eax
  8025e5:	89 da                	mov    %ebx,%edx
  8025e7:	f7 f7                	div    %edi
  8025e9:	89 d0                	mov    %edx,%eax
  8025eb:	31 d2                	xor    %edx,%edx
  8025ed:	83 c4 1c             	add    $0x1c,%esp
  8025f0:	5b                   	pop    %ebx
  8025f1:	5e                   	pop    %esi
  8025f2:	5f                   	pop    %edi
  8025f3:	5d                   	pop    %ebp
  8025f4:	c3                   	ret    
  8025f5:	8d 76 00             	lea    0x0(%esi),%esi
  8025f8:	89 f2                	mov    %esi,%edx
  8025fa:	39 d8                	cmp    %ebx,%eax
  8025fc:	76 12                	jbe    802610 <__umoddi3+0x50>
  8025fe:	89 f0                	mov    %esi,%eax
  802600:	89 da                	mov    %ebx,%edx
  802602:	83 c4 1c             	add    $0x1c,%esp
  802605:	5b                   	pop    %ebx
  802606:	5e                   	pop    %esi
  802607:	5f                   	pop    %edi
  802608:	5d                   	pop    %ebp
  802609:	c3                   	ret    
  80260a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  802610:	0f bd e8             	bsr    %eax,%ebp
  802613:	83 f5 1f             	xor    $0x1f,%ebp
  802616:	75 50                	jne    802668 <__umoddi3+0xa8>
  802618:	39 d8                	cmp    %ebx,%eax
  80261a:	0f 82 e0 00 00 00    	jb     802700 <__umoddi3+0x140>
  802620:	89 d9                	mov    %ebx,%ecx
  802622:	39 f7                	cmp    %esi,%edi
  802624:	0f 86 d6 00 00 00    	jbe    802700 <__umoddi3+0x140>
  80262a:	89 d0                	mov    %edx,%eax
  80262c:	89 ca                	mov    %ecx,%edx
  80262e:	83 c4 1c             	add    $0x1c,%esp
  802631:	5b                   	pop    %ebx
  802632:	5e                   	pop    %esi
  802633:	5f                   	pop    %edi
  802634:	5d                   	pop    %ebp
  802635:	c3                   	ret    
  802636:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80263d:	8d 76 00             	lea    0x0(%esi),%esi
  802640:	89 fd                	mov    %edi,%ebp
  802642:	85 ff                	test   %edi,%edi
  802644:	75 0b                	jne    802651 <__umoddi3+0x91>
  802646:	b8 01 00 00 00       	mov    $0x1,%eax
  80264b:	31 d2                	xor    %edx,%edx
  80264d:	f7 f7                	div    %edi
  80264f:	89 c5                	mov    %eax,%ebp
  802651:	89 d8                	mov    %ebx,%eax
  802653:	31 d2                	xor    %edx,%edx
  802655:	f7 f5                	div    %ebp
  802657:	89 f0                	mov    %esi,%eax
  802659:	f7 f5                	div    %ebp
  80265b:	89 d0                	mov    %edx,%eax
  80265d:	31 d2                	xor    %edx,%edx
  80265f:	eb 8c                	jmp    8025ed <__umoddi3+0x2d>
  802661:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802668:	89 e9                	mov    %ebp,%ecx
  80266a:	ba 20 00 00 00       	mov    $0x20,%edx
  80266f:	29 ea                	sub    %ebp,%edx
  802671:	d3 e0                	shl    %cl,%eax
  802673:	89 44 24 08          	mov    %eax,0x8(%esp)
  802677:	89 d1                	mov    %edx,%ecx
  802679:	89 f8                	mov    %edi,%eax
  80267b:	d3 e8                	shr    %cl,%eax
  80267d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802681:	89 54 24 04          	mov    %edx,0x4(%esp)
  802685:	8b 54 24 04          	mov    0x4(%esp),%edx
  802689:	09 c1                	or     %eax,%ecx
  80268b:	89 d8                	mov    %ebx,%eax
  80268d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802691:	89 e9                	mov    %ebp,%ecx
  802693:	d3 e7                	shl    %cl,%edi
  802695:	89 d1                	mov    %edx,%ecx
  802697:	d3 e8                	shr    %cl,%eax
  802699:	89 e9                	mov    %ebp,%ecx
  80269b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  80269f:	d3 e3                	shl    %cl,%ebx
  8026a1:	89 c7                	mov    %eax,%edi
  8026a3:	89 d1                	mov    %edx,%ecx
  8026a5:	89 f0                	mov    %esi,%eax
  8026a7:	d3 e8                	shr    %cl,%eax
  8026a9:	89 e9                	mov    %ebp,%ecx
  8026ab:	89 fa                	mov    %edi,%edx
  8026ad:	d3 e6                	shl    %cl,%esi
  8026af:	09 d8                	or     %ebx,%eax
  8026b1:	f7 74 24 08          	divl   0x8(%esp)
  8026b5:	89 d1                	mov    %edx,%ecx
  8026b7:	89 f3                	mov    %esi,%ebx
  8026b9:	f7 64 24 0c          	mull   0xc(%esp)
  8026bd:	89 c6                	mov    %eax,%esi
  8026bf:	89 d7                	mov    %edx,%edi
  8026c1:	39 d1                	cmp    %edx,%ecx
  8026c3:	72 06                	jb     8026cb <__umoddi3+0x10b>
  8026c5:	75 10                	jne    8026d7 <__umoddi3+0x117>
  8026c7:	39 c3                	cmp    %eax,%ebx
  8026c9:	73 0c                	jae    8026d7 <__umoddi3+0x117>
  8026cb:	2b 44 24 0c          	sub    0xc(%esp),%eax
  8026cf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  8026d3:	89 d7                	mov    %edx,%edi
  8026d5:	89 c6                	mov    %eax,%esi
  8026d7:	89 ca                	mov    %ecx,%edx
  8026d9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  8026de:	29 f3                	sub    %esi,%ebx
  8026e0:	19 fa                	sbb    %edi,%edx
  8026e2:	89 d0                	mov    %edx,%eax
  8026e4:	d3 e0                	shl    %cl,%eax
  8026e6:	89 e9                	mov    %ebp,%ecx
  8026e8:	d3 eb                	shr    %cl,%ebx
  8026ea:	d3 ea                	shr    %cl,%edx
  8026ec:	09 d8                	or     %ebx,%eax
  8026ee:	83 c4 1c             	add    $0x1c,%esp
  8026f1:	5b                   	pop    %ebx
  8026f2:	5e                   	pop    %esi
  8026f3:	5f                   	pop    %edi
  8026f4:	5d                   	pop    %ebp
  8026f5:	c3                   	ret    
  8026f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8026fd:	8d 76 00             	lea    0x0(%esi),%esi
  802700:	29 fe                	sub    %edi,%esi
  802702:	19 c3                	sbb    %eax,%ebx
  802704:	89 f2                	mov    %esi,%edx
  802706:	89 d9                	mov    %ebx,%ecx
  802708:	e9 1d ff ff ff       	jmp    80262a <__umoddi3+0x6a>
